/    Sign up×
Community /Pin to ProfileBookmark

xhtml standards and flash

Has anyone figured out a way to get flash into an xhtml page and have it pass validation? The tags that are needed for it to play in all browsers just do not seem to get there. If anyone has an example, I would love to see it.

I am currently using this:

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ width=”39″ height=”39″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″>
<param name=”movie” value=”wimpy_button.swf?theFile=audio.mp3″ />
<param name=”quality” value=”high” />
<param name=”bgcolor” value=”white” />
<embed src=”wimpy_button.swf?theFile=audio.mp3″ quality=”high” bgcolor=”white” width=”39″ height=”39″
type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer”>
</embed>
</object>

to post a comment
HTML

21 Comments(s)

Copy linkTweet thisAlerts:
@tegraphixOct 21.2005 — what errors are coming up that don't let it pass validation?
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 21.2005 — all the param and attributes are invalid, the tags are invalid, i get 18 errors and a bunch or warnings on just those lines I posted above.
Copy linkTweet thisAlerts:
@tegraphixOct 21.2005 — i would need a link to your page, or a link to the validation page that shows all the errors so i know exactly what the errors are.

off-hand, the parm lines should end with " />" instead of ">". and all attributes (width, height, etc.) should all be lowercase.
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 22.2005 — EDIT >>

Reposted the above code. Now down to errors that say embed is undefined and all the attributes in it are invalid. 8 errors.

Getting closer. Bit not quite there yet,
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 22.2005 — OK - bottom line after doing more reading is that xhtml just does not support the <embed> tag. So it appears you cannot be xhtml standards compliant and use flash since you need the embed tag for non IE browsers.

EDIT >> interesting reading on the subject

http://www.alistapart.com/articles/flashsatay/
Copy linkTweet thisAlerts:
@the_treeOct 22.2005 — Surely if you'd read the ALA article then you would realise that you [i]can[/i] use flash whilst being (x)html compliant.
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 22.2005 — Surely if you'd read the ALA article then you would realise that you [i]can[/i] use flash whilst being (x)html compliant.[/QUOTE]
I guess you and I read two different articles ?

What I see is you nedd to have custom containers for all your flash (so you cannot use off the shelf content) and you loose the codebase functionality.

The only conclusion that I can draw is that the W3C standards group must be in bed with Microsoft to exclude the <embed> tag that is used by everyone else.
Copy linkTweet thisAlerts:
@drhowarddrfineOct 22.2005 — W3C standards group must be in bed with Microsoft to exclude the <embed> tag[/QUOTE]Not hardly. I haven't read about how to do this in a long time but there is some trick to doing this. The problem has to do with the flash code you are using and not <embed> but I don't recall what it is. I'll try to look it up.
Copy linkTweet thisAlerts:
@the_treeOct 22.2005 — Purely from your code and the article:&lt;object
style="width: 39px; hieght: 39px; background-color: #fff;"
type="application/x-shockwave-flash"
data="wimpy_button.swf?theFile=audio.mp3"
<i>&gt;</i>
&lt;param name="movie" value="wimpy_button.swf?theFile=audio.mp3" /&gt;
&lt;!-- Alternate Content --&gt;
&lt;/object&gt;
Embed [i]never[/i] appeared in HTML or XHTML specifications so I don't see why IE should support it any more than Gecko should support coloured scrollbars.
Copy linkTweet thisAlerts:
@drhowarddrfineOct 22.2005 — Well, it goes to show you how much I use <embed> or flash. <embed> isn't even an html 4 tag. It's recommended to use <object>. <embed> is an old netscape tag that is backwards compatible in many browsers but not standard.
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 22.2005 — Purely from your code and the article:&lt;object
style="width: 39px; hieght: 39px; background-color: #fff;"
type="application/x-shockwave-flash"
data="wimpy_button.swf?theFile=audio.mp3"
<i>&gt;</i>
&lt;param name="movie" value="wimpy_button.swf?theFile=audio.mp3" /&gt;
&lt;!-- Alternate Content --&gt;
&lt;/object&gt;
Embed [i]never[/i] appeared in HTML or XHTML specifications so I don't see why IE should support it any more than Gecko should support coloured scrollbars.[/QUOTE]

That code works fine in IE. But Firefox does not see it.

I guess I should say code that is standards compliant AND works in IE and Firefox.
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 22.2005 — Looks like there is no way to get Firefox to see flash without the <embed> tag. You would think there would be some level of discussion between the browser big boys and the standards boys. In this case, Microsoft seems to have won the battle. They made the standard. And Firefox seems to have ignored it - with a brand new browser no less. So sad everyone cannot play together in the sandbox.
Copy linkTweet thisAlerts:
@drhowarddrfineOct 22.2005 — The <embed> tag has not existed since html2.0, I believe. IE still has it for backwards compatability but they, too, have depracated it way back then.

They did not make the standard. The W3C did. The w3c AND MS now say to use <object> and NOT <embed>.

Firefox isn't ignoring anything. It is IE which is not playing in the sandbox. And [URL=http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx]they admit they are far behind, even on IE7.[/URL]
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 23.2005 — But it is Firefox that ignores the <object> tag in this case. If Firefox could play flash with the <object> tag then I could drop the <embed> tag. I am not worried about old browsers. But you cannot get the same code to work for both IE6 and Firefox. If I could get a version of the above code that works in both FF and IE6, that is xhtml strict compliant, I would be happy. IE6 easy. FF cannot seem to be done. So in this case it seems to be FF that is not standards compliant.
Copy linkTweet thisAlerts:
@drhowarddrfineOct 23.2005 — Well, no, and I'll look it up later.
Copy linkTweet thisAlerts:
@drhowarddrfineOct 23.2005 — [URL=http://devedge-temp.mozilla.org/viewsource/2002/scripting-flash/#object]This is older[/URL] but may have your answers. I have only scanned it.

You can also [URL=http://www.mozilla.org/quality/browser/front-end/testcases/plugins/flashtest.html]look at code here.[/URL]
Copy linkTweet thisAlerts:
@Beach_BumauthorOct 23.2005 — Good examples that pretty much prove the point. The first page explains why it does not work. The links all show pages that use the <embed> tag to make the flash work.
Copy linkTweet thisAlerts:
@ccoppenbargerNov 03.2005 — Has anyone figured out a way to get flash into an xhtml page and have it pass validation? The tags that are needed for it to play in all browsers just do not seem to get there. If anyone has an example, I would love to see it.

I am currently using this:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="39" height="39"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">
<param name="movie" value="wimpy_button.swf?theFile=audio.mp3" />
<param name="quality" value="high" />
<param name="bgcolor" value="white" />
<embed src="wimpy_button.swf?theFile=audio.mp3" quality="high" bgcolor="white" width="39" height="39"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>[/QUOTE]

Use the following code:
[CODE]<object type="application/x-shockwave-flash" width="39" height="39"
data="wimpy_button.swf?theFile=audio.mp3">
<param name="movie" value="wimpy_button.swf?theFile=audio.mp3" />
<param name="quality" value="high" />
<param name="bgcolor" value="white" />
</object>[/CODE]


That should be standards compliance. If it complains about the width and height, just put a class on the object and specify the width and height in a CSS class, which you should probably do anyway. I've couldn't figure this out either, but finally played around it with it long enough and got it to validate at xhtml 1.0 Strict on the front page of [URL=http://www.ciu.edu]http://www.ciu.edu[/URL]. I hope this helps.
Copy linkTweet thisAlerts:
@Beach_BumauthorNov 03.2005 — That definately validates. Very nice. Thanks.

The one thing it gives up is the plugin/codebase so if the player is not installed, too bad. It is quite funcky. If you try to put in the codebase for IE then FireFox does not display at all. The browser boys seem to do this stuff intentionally to further the war.

Thanks for your effort ?
Copy linkTweet thisAlerts:
@ccoppenbargerNov 04.2005 — That definately validates. Very nice. Thanks.

The one thing it gives up is the plugin/codebase so if the player is not installed, too bad. It is quite funcky. If you try to put in the codebase for IE then FireFox does not display at all. The browser boys seem to do this stuff intentionally to further the war.

Thanks for your effort ?[/QUOTE]


I believe Macromedia is empasizing a javascript detection script to detect if a user has a plugin. Also, Version 8 is supposed to autodetect the plugin as well, but It's been kind of buggy for me. You can put html code inside the object tag such as:
[CODE]Flash Plugin has not been detected, please visit Macromedia's Website at http://www.macromedia.com to download the latest plugin and then revisit us to view the plugin.[/CODE]

I recommend pointing them directly to the plugin page. Of Course, they'll have to restart their browser to view the plugin too. The new plugin detection in Version 8 is supposed to solve this, but I haven't gotten it to work yet.
Copy linkTweet thisAlerts:
@Beach_BumauthorNov 04.2005 — Version 8 is supposed to autodetect the plugin as well, but It's been kind of buggy for me.[/QUOTE]
That would have to be voodoo for a plugin that is not there to detect that it is missing ?

Sort of like asking all those who are not in the room to raise their hands. No wonder it does not work. ?
×

Success!

Help @Beach_Bum spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...