Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 01-07-2006, 06:48 PM
Banned
 
Join Date: 12-07-05
Location: Birmingham, Michigan
Posts: 29
iTrader: 0 / 0%
HTML Validation and Flash Embed Tag

Hello Everyone,

We had the pleasure of learning something new today and thought this might help others as well. We had to spend quite some time searching to get the right answer.

Go to W3C http://www.w3c.org and go to the HTML Validation. If you are using Flash on a web page ask that this page be validated. Details on how to do this can be found on that page.

Most likely if you use the standard Flash tags, one of them will be the "embed" tag. Unfortunatley, W3C will not recognize this to be a valid HTML tag. Truly and absolutely amazing! Everyone uses the "embed" tag with a flash movie in their HTML code. It is the primary method that Mozilla browsers use to run the flash movie.

After some research in the "Bugs" area of the W3C website, there were others that had submitted the exact same question wondering "why". The answer to the problem can be found at this url that was recommended in one of the "bug" responses at the W3C:

http://www.alistapart.com/articles/flashsatay/

In summary, you need to remove the "embed" tag and in your "object" tag you would
- remove the CLSID and the CODEBASE within the "object" tag.
- add DATA and TYPE to your object tag.
- if you have not already, then you would also include the PARAM as an example below.

<object data="flashmoviename.swf" type="application/x-shockwave-flash" width="504" height="250">
<param name="MOVIE" value="flashmoviename.swf">
</object>

This method will not only insure that your HTML code is validated, but this will work for both IE and Mozilla browsers. We tried it today and had no difficulty with our flash movies on our site in either browser type.

Hope this helps others.

Last edited by smartfinds; 01-07-2006 at 07:08 PM.
 
Reply With Quote

Advertisement

Advertisement

  #2 (permalink)  
Old 01-07-2006, 07:05 PM
kwvarga's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,522
iTrader: 0 / 0%
Nice, thanks for the info
 
Reply With Quote
  #3 (permalink)  
Old 01-08-2006, 10:14 AM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
Nice
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #4 (permalink)  
Old 01-08-2006, 10:14 AM
Michael Allison's Avatar
Senior Member
Latest Blog:
None

 
Join Date: 12-08-05
Location: Spokane, WA
Posts: 750
iTrader: 0 / 0%
Cool deal!!

That always bugged me, but not enough to do anything about it...

-Michael
 
Reply With Quote
  #5 (permalink)  
Old 06-05-2006, 01:57 PM
kingpixel's Avatar
Junior Member
 
Join Date: 06-05-06
Posts: 1
iTrader: 0 / 0%
i have used this method in the past, and it works great but has some drawbacks. While it is true that it passes validation, and it works in most/all browsers, it has a basic flawand that is this: it does not stream flash content to IE browsers. meaning, it waits for the entire movie to cache locally before showing a single frame. This is a result of the "data=" part of the tag. It is most inconvenient for very large flash files (like video) and requires the work-around of loading a small container .swf first that then loads your main content. and since you must pass a reference to the main content in the object tag, it makes templatizing your flash embeds more difficult.

On another note, just today I noticed that simply formatted embed tag seems to work for embedding flash in all browsers. For more than a year I've hearing the evils of the embed and how it will soon be gone, only to find that the embed turns out to be the most reliable. I'm beginning to think this whole w3c and validation biz might just be for the birds.

here's the code snippet that worked:

<embed width="320" height="240" menu="true" loop="true" play="true" src="movie.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
 
Reply With Quote
  #6 (permalink)  
Old 06-06-2006, 12:24 AM
JamieJelly's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 03-09-06
Posts: 1,250
iTrader: 0 / 0%
this is interesting: http://www.alistapart.com/articles/flashsatay/
 
Reply With Quote
  #7 (permalink)  
Old 10-06-2007, 07:01 AM
Junior Member
 
Join Date: 10-06-07
Posts: 2
iTrader: 0 / 0%
<div id="flashbox">
<embed src="Intro.swf" width="541px" height="368px"> </embed>
</div>
It will not validate do you have any idea?

I read about what you sayed

<object data="flashmoviename.swf" type="application/x-shockwave-flash" width="504" height="250">
<param name="MOVIE" value="flashmoviename.swf">
</object>

But it doesn’t help me
So if you have a minute please let me know
 
Reply With Quote
  #8 (permalink)  
Old 10-07-2007, 08:21 PM
kimberlybarryd's Avatar
Member
Latest Blog:
None

 
Join Date: 07-12-07
Location: Nova Scotia Canada
Posts: 58
iTrader: 0 / 0%
This will validate to strict. Create a .gif the same size as your .swf and name it needplugin.gif
HTML Code:
<object type="application/x-shockwave-flash" data="images/your.swf" width="765" height="70"> <param name="movie" value="images/your.swf" /> <param name="BGCOLOR" value="#000000" /> <a title="You must install the Flash Plugin for your Browser in order to view this movie" href="http://www.macromedia.com/shockwave/download/alternates/"><img src="images/needplugin.gif" width="765" height="70" alt="placeholder for flash movie" /></a> </object>
__________________
Ya Gotta Have It

Last edited by kimberlybarryd; 10-07-2007 at 08:38 PM.
 
Reply With Quote
  #9 (permalink)  
Old 10-27-2007, 04:42 PM
Junior Member
 
Join Date: 10-06-07
Posts: 2
iTrader: 0 / 0%
embed tag

anybody how i validate



<div id="flashbox"><embed type="application/x-shockwave-flash" src="Teach%20My%20Toddler%20-%20The%20all-in-one%20learning%20system%20for%20toddlers%21_files/intro.swf" id="inside" name="inside" bgcolor="#ffffff" quality="high" height="368" width="541">
</div><!--close flashbox-->
 
Reply With Quote
  #10 (permalink)  
Old 08-26-2008, 06:13 AM
Junior Member
 
Join Date: 08-26-08
Location: London, United Kingdom
Posts: 7
iTrader: 0 / 0%
Hello,

To embed a simple flash file into your site and keep it fully validated, you can use the following codes depending on the DOCTYPE that has been defined.

For HTML 4.01 Transitional:

Code:
<object data="path_to_file/file.swf" type="application/x-shockwave-flash" width="insert_width_of_movie" height="insert_height_of_movie"> <param name="movie" value="path_to_file/file.swf"> </object>
For HTML 4.01 Strict (requires a container around code):

Code:
<div class="cFlashMovie"> <object data="path_to_file/file.swf" type="application/x-shockwave-flash" width="insert_width_of_movie" height="insert_height_of_movie"> <param name="movie" value="path_to_file/file.swf"> </object> </div>
If you do not wish to assign a CSS Class or ID to the Div, then just use
Code:
<div></div>
around the flash code. Alternatively, you may use various other containers such as
Code:
<p></p>
.

For XHTML 1.0 Transitional (requires self-closing end to param):

Code:
<object data="path_to_file/file.swf" type="application/x-shockwave-flash" width="insert_width_of_movie" height="insert_height_of_movie"> <param name="movie" value="path_to_file/file.swf" /> </object>
For XHTML 1.0 Strict (requires a container around code):

Code:
<div class="cFlashMovie"> <object data="path_to_file/file.swf" type="application/x-shockwave-flash" width="insert_width_of_movie" height="insert_height_of_movie"> <param name="movie" value="path_to_file/file.swf" /> </object> </div>
Those are four validated flash embed codes for the most common DOCTYPES used in Web Development. These will validate fine as long as the rest of your code is good. Hopefully this post helps people in the future.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML and Flash Aliya Coding Forum 5 11-11-2007 05:26 AM
flash based on an html page zoran Web Design Lobby 1 01-12-2007 05:37 AM
Flash or Html franklin Webmaster Revenue 26 08-24-2004 08:08 PM
&amp; in URLS for HTML validation thing2b Web Design Lobby 4 06-28-2004 10:01 AM
html/flash kwvarga Coding Forum 4 06-03-2004 09:59 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:45 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2014 Escalate Media




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.