Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1298 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Embedding flash but....

Thread title: Embedding flash but....
Closed Thread    
    Thread tools Search this thread Display Modes  
08-12-2004, 06:01 PM
#1
stoavio is offline stoavio
stoavio's Avatar
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 237
iTrader: 0 / 0%
 

stoavio is on a distinguished road

Send a message via AIM to stoavio Send a message via MSN to stoavio

  Old  Embedding flash but....

When I embed flash my code won't validate. What's a good way around this?

08-12-2004, 06:13 PM
#2
stoavio is offline stoavio
stoavio's Avatar
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 237
iTrader: 0 / 0%
 

stoavio is on a distinguished road

Send a message via AIM to stoavio Send a message via MSN to stoavio

  Old

I guess there really isn't a good way to embed flash and have the page validate as XHTML 1.0 Trans. Flash is a proprietary technology which goes against the open standards such as HTML, CSS, etc so I don't really think there is a good way to go about this. The Satay method only works on smaller flash movies. If anyone comes up with something please let me know!

08-12-2004, 08:00 PM
#3
Evo is offline Evo
Status: Junior Member
Join date: Aug 2004
Location:
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

Evo is on a distinguished road

Send a message via MSN to Evo

  Old

I was about to post the satay method, then I saw the next post.
I looked through the discussion at ALA and noticed something new, the Javay method.
May aswell try it.

Originally Posted by RazorX
Well, the author of davidsonbicycles.com is simply wrapping <script type="text/javascript"> //<![CDATA[ around the embed tag. The embed tag is no longer a valid XHTML tag/element. The Flash Satay and many of the posts to it, have also confirmed that embed is no longer needed. Simply hiding it from the validator is not anything hair-raising, however, when the element is not needed, then it's a waste of code.

In trying to be XHTML compliant, the main issues revolve around the fact, that anytime IE 6 or less encounters the data element, it will not stream a movie.swf. To add to the problems, using a container movie to fix streaming in IE can add new troubles in Flash (read previous posts), also you cannot detect minor Flash player versions using client-side VBScript for an IE browser, so now your codebase="" becomes important to catch minor Flash versions in IE. Minor Flash detection becomes vital when determining what ActionScript elements to use or not to use based on bugs within a particular minor version and/or player release. All of these issues have been thoroughly covered in previous posts though.

So, all that being said, if I am being forced to use a JavaScript "hack and hide" with //<![CDATA[ to pass validation and to get IE to work right, then my personal choice is to feed IE what it wants. This allows me to maintain the ability to stream the larger .swf files, and still detect for minor Flash versions in the visiting IE browser if needed.

My preferred and final solution, which I have dubbed Javay, is a simple block of code I have tested in many browsers:

<script type="text/javascript" language="javascript">
//<![CDATA[ /// Flash Javay method
var ua = navigator.userAgent.toLowerCase();
if ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)){
document.write('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/…" width="500" height="500">');
document.write('<param name="movie" value="movie.swf" /> </object> '); }
else{ document.write('<object data="movie.swf" type="application/x-shockwave-flash" width="500" height="500"></object>'); }
//]]>
</script>

<noscript>
<object data="movie.swf" type="application/x-shockwave-flash" width="500" height="500">
<param name="movie" value="movie.swf" /></object>
</noscript>

(Of course, now the future threat of Eolas/IE may force me to change how this code is delivered to the page.)

And when I need my Flash object to be 100% width and height, then I use this CSS selection in addition to the Javay:

<style type="text/css">
html,body {margin: 0; padding: 0; height: 100%;}
</style>

But in all fairness, perhaps the author of davidsonbicycles created the site long before this research was available. So, credit may be in order for cleverness. In the past, I have been bad at maintaining web standards in some of my site designs. I too have sinned.

It's also good that you are dead-set on maintaining web standards. Web developers/designers with such enthusiasm are few and far between. It's important that we continue to trade ideas and encourage each other in this important issue of XHTML compliance, because if we don't push it, then no one else will.

08-13-2004, 07:21 AM
#4
Travis is offline Travis
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 445
iTrader: 0 / 0%
 

Travis is on a distinguished road

  Old

I am not sure how to explain it but as far as I know <embed> was a tag created by macromedia and hence as you know it is not valid code by the standards. You actually dont need the embed tag to have flash on your site. If you use the object tag and spefify the mimetype in that tag: type="application/x-shockwave-flash" your code will be valid. However there is a slight problem with this that will almost guarentee you will prefer to use embed... That is that preloaders in flash are pretty much pointless and the flash loads as if it is a broken image without the embed tag.

I havent had a look at Alistapart but I am assuming the javascript method you are talking about is creating a function to display the flash then when code is checked in the validator it appears valid. Generally this is a pretty good way of doing things any way because you can script functions to check if the user has flash installed and deal with it appropriately etc. However this does not mean the code is valid it is just that the code is not being passed through the validator.

I think this is the one exception you should make for validation at this stage though as the embed tag works fine in all browsers at this stage and it is not that hard to change if browsers decide to stop interperating the embed tag in the future.

08-14-2004, 07:54 PM
#5
Evo is offline Evo
Status: Junior Member
Join date: Aug 2004
Location:
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

Evo is on a distinguished road

Send a message via MSN to Evo

  Old

karl, he said he has used the Satay method, but isn't what he needs.

08-18-2004, 06:19 PM
#6
stoavio is offline stoavio
stoavio's Avatar
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 237
iTrader: 0 / 0%
 

stoavio is on a distinguished road

Send a message via AIM to stoavio Send a message via MSN to stoavio

  Old

Well Arjen from www.cgaros.com used the Javay method and his page validates as XHTML 1.0 Transitional perfectly. I think I'll go with the Javay method

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed