How do YOU add Flash to your (X)HTML valid Webpages?

There are a fair few solutions scattered across the depths of the World Wide Web, but how do YOU add Flash to your (X)HTML valid Webpages?

I’m obviously interested in what methods different members on the SitePoint Forums use for adding Flash .swf documents to their (X)HTML valid Webpages but there is a much cheekier underlying purpose for this thread. I’ve done some research online today looking for the most cleanest, stablest, appropriate, and W3C HTML 4.01 Strict valid solution but I really need some help!

So I guess what I’m also asking is: Do you have a solution for adding Flash .swf documents to your Web pages? And at the same time do you manage to keep them (the HTML 4.01 Strict or XHTML 1.0 Strict Web pages) W3C valid / compliant?

And the SP Forums member who provides me with the solution I’ll end up using, that manages to keep my HTML 4.01 Strict valid Web page valid will be showered with love, hugs, and kisses. :lovestruck:

…Not really. But the thought that you’ve helped a member of the SP Forums Community and that they’ll love you forever is good enough, eh? :smiley:

Any help that anyone can provide is appreciated. Oh, and did I mention that I’d prefer the solution without the need to rely on JavaScript?..Well now I just did :slight_smile: Hehe! :stuck_out_tongue:

Andrew Cooper

Thanks for another version! :slight_smile: Appreciated :wink:

Off Topic:

Oi! Lucky you avoided both?! I’m just sharing the love around here! Cheeky sod you are! :stuck_out_tongue: :lol:

Hey I don’t either! :eek: I’ve never seen a use for Flash in any Website I’ve ever made however, as part of a Web Design competition brief I was required to include a 3 second animation. I frowned at the project brief but I needed to include it. What was even worse was actually creating the animation - I’m terrible with Adobe Flash.

Thanks for all your help guys :slight_smile: I really needed that solution in time to send off my competition entry and everything has worked out fine. Thanks again for the help. :slight_smile:

Andrew Cooper

Version checking is mostly to see the difference between AS2 and AS3. AS3 really is a complete language. Depends on how much interaction the user is expected to be able to do.
I always saved banner ads under AS2 and for Flash 8 or 6 (depending on how low I could go). They don’t have to do more than get a url if you click them.

And to replace the best way to do that is JavaScript which can also determine if Flash is available.

Or, let the alt content that you put there simply show because there’s no Flash to cover it up (unless you have NoScript, but that is I believe a NoScript issue, not a Flash or <object> issue). No detection necessary.

However I’ll give you that SWF-ish programs let you detect Flash version which may be useful depending on what you’re doing with Flash.

And I believe Flash relies on…Flash? If you are going to add Flash content you need to provide an alternative to Flash content and the best way to do that is to replace it. And to replace the best way to do that is JavaScript which can also determine if Flash is available.

Abso-posi-lutely! Of course a certain well known vendor has chosen not to support alternative content for object. I don’t think it matters all that much since people tend to either run Flash or not, and Adobe is OC about upgrade notification.

However I’ll give you that SWF-ish programs let you detect Flash version which may be useful depending on what you’re doing with Flash.
I won’t. Plug-in sniffing is as ridiculous as browser sniffing. In the case of Flash, several sites, big ones that should know better, sniff Flash versions and come up empty on my machines. If the content doesn’t run well, wouldn’t the visitor notice, anyway? I don’t get to find out. All I get to see is a message telling me to install Flash 10. I have the Debian flashplayer-mozilla v10.0.42.34-0.0 package from Adobe, that works just fine, thank you. That’s as new as it gets, at this time.

If I understand correctly, my plugins are abstracted by a plugin wrapper that handles multimedia. There are 2 VLC Multimedia Plugins, Quicktime, Windows Media Player, DivX Web Player, and Flash Player; all handled by the Totem abstraction layer. I guess sniffers don’t know how to ask nicely. :slight_smile:

cheers,

gary

Thanks for the information :slight_smile: I had a look at SWF Object but I believe it relies on JavaScript which isn’t what I wanted to do. Thanks all the same though.

I only asked myself that question after I submitted the competition entry. It didn’t state using Flash either. I’m more proficient in Flash though than anything else, and even in Flash I’m terrible! :eek:

Lawlz. :lol: @ Zed & Maynard

Andrew Cooper

as part of a Web Design competition brief I was required to include a 3 second animation.

Did it have to be Flash?

http://www.messageinabox.tacticaltech.org/node/279

Zed: Bring out the Gimp.
Maynard: Gimp’s sleeping.
Zed: Well, I guess you’re gonna have to go wake him up now, won’t you?

I use SWF Object. It has more uniform performance than embedding in terms of interacting with drop-down menus and the like. Embedding the Flash will also trigger a “download this video” IE RealPlayer plugin which is usually good to avoid.

I replace textual/html content with Flash content using JavaScript. Either way, they don’t have Flash or JavaScript they still get the relative data.
I took jQuery SWFObject and extensively modified it for my own uses.

See http://www.alistapart.com/articles/byebyeembed/

What you are really asking is; how do we generally avoid browser bugs when embedding “objects” and it looks like you might have to hug Stephen and I’d probably use a similar method. Though in the past - about 10-years ago - I’d have probably either created new elements or used JavaScript to get around buggy-browsers.

-Hugs and…- Ahem! Thanks so much Stephen! It’s worked perfectly and my page still validates as HTML 4.01 Strict :slight_smile: Especially thank you for the quick and prompt reply, I needed it!

I guess so. I really just needed a quick solution to adding Flash to my Web pages without relying on JavaScript but also still having the pages validate with the strict DTD :slight_smile: And I know you really wanted that hug :wink: :lol:

I guess that’s that problem solved then!..Talk about a discussion killer Stephen! :smiley:

Andrew Cooper


<object
	type="application/x-shockwave-flash"
	data="custom.swf"
	width="580"
	height="435"
>
	<param name="movie" value="custom.swf" />
	<param name="quality" value="high" />
	<!-- alternative content should go here -->
</object>

End of problem. Oh noes, it might ask you to click ‘ok’ in versions of IE people shouldn’t be using anymore. (as opposed to scripted solutions that will ask you if it’s ok to run the content in 7/8 - net change zero).

Better that it ask in antiquated browsers that people ought to be thinking about upgrading and where the number of people using them is falling rather than asking in more modern browsers that people are upgrading to. That way the problem eventually solves itself.

[ot]

As-long is it wasn’t the “kiss” option I could just about live with it… but lucky for me I avoided both. ;)[/ot]

I don’t. :slight_smile:

Do you need fallback? If not, a simple <embed src=flash.swf> works cross-browser (and is valid html5).

By the time HTML5 becomes the standard a simple <object> tag will handle it. IE6 will be gone long before HTML5 is finished so adding a tag that does the same thing as the object tag is redundant. I’d expect the embed tag to be dropped from the HTML5 proposal once IE6 is dead since it becomes superfluous at that point since the only complication of the object tag is the different version that IE6 requires plus since the object tag is already a part of the HTML4 standards it is probably supported by more of the less common browsers than the currently proprietary embed tag is.