SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Guru bronze trophy AndrewCooper's Avatar
    Join Date
    Sep 2008
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    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.

    ...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?

    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 Hehe!

    Andrew Cooper

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    SitePoint Guru bronze trophy AndrewCooper's Avatar
    Join Date
    Sep 2008
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    -Hugs and..- Ahem! Thanks so much Stephen! It's worked perfectly and my page still validates as HTML 4.01 Strict Especially thank you for the quick and prompt reply, I needed it!

    Quote Originally Posted by xhtmlcoder View Post
    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.
    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 And I know you really wanted that hug

    I guess that's that problem solved then!....Talk about a discussion killer Stephen!

    Andrew Cooper

  5. #5
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <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).

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    [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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Quote Originally Posted by AndrewCooper View Post
    [...]And I know you really wanted that hug
    As-long is it wasn't the "kiss" option I could just about live with it... but lucky for me I avoided both.

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AndrewCooper View Post
    how do YOU add Flash to your (X)HTML valid Webpages?
    I don't.

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

  9. #9
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by zcorpan View Post
    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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  10. #10
    SitePoint Guru bronze trophy AndrewCooper's Avatar
    Join Date
    Sep 2008
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    Code:
    <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).
    Thanks for another version! Appreciated

    Quote Originally Posted by xhtmlcoder View Post
    Off Topic:



    As-long is it wasn't the "kiss" option I could just about live with it... but lucky for me I avoided both.
    Off Topic:

    Oi! Lucky you avoided both?! I'm just sharing the love around here! Cheeky sod you are!


    Quote Originally Posted by zcorpan View Post
    I don't.

    Do you need fallback? If not, a simple <embed src=flash.swf> works cross-browser (and is valid html5).
    Hey I don't either! 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 I really needed that solution in time to send off my competition entry and everything has worked out fine. Thanks again for the help.

    Andrew Cooper

  11. #11
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    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.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  12. #12
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    936
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

    http://code.google.com/p/swfobject/

  13. #13
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    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.gimp.org/tutorials/Using_GAP/
    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?

  14. #14
    SitePoint Guru bronze trophy AndrewCooper's Avatar
    Join Date
    Sep 2008
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by eruna View Post
    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.

    http://code.google.com/p/swfobject/
    Thanks for the information 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.

    Quote Originally Posted by Stomme poes View Post
    Did it have to be Flash?

    http://www.gimp.org/tutorials/Using_GAP/
    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 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!

    Lawlz. @ Zed & Maynard

    Andrew Cooper

  15. #15
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AndrewCooper View Post
    ...but I believe it relies on JavaScript...
    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.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  16. #16
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    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.

  17. #17
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    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.
    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.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  18. #18
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •