SitePoint Forums - View Single Post - force f...

来源:百度文库 编辑:神马文学网 时间:2024/04/29 21:10:57
Thread: force flash to play below dhtml menu? View Single Post Nov 16, 2006, 14:57   #44 mhulse .•*º draziW tnioPetiS º*•.  
Join Date: Jun 2004 Location: "Then I figure the most good good guy will win." Posts: 1,613 [solution] Flash, Suckerfish, (d)html hidden, wmode opaque/transparent...
TinyURL for this post: http://tinyurl.com/yk3jdg

I have noticed these types of questions popping-up from time-to-time... so I thought I would dedicate a thread (twas moved to this thread) with all the answers that I am aware of... Hopefully it will save others time in the future:
  • By default, Flash is always on top.
  • Applying a wmode of opaque or transparent is the solution [for most situations].

    Read this... more specifically view this example.
    Quote: Conclusion

    This article has shown you reasons you may want to use opaque mode in your Flash movies. Opaque mode allows your DHTML drop down menus to stay in front of your Flash movie as well as hiding non-essential Flash from screen readers. Yes, transparent mode will also allow your DHTML drop down menus to render properly and will hide non-essential Flash, but due to possible performance issues, that's best left for opaque mode. Use transparent mode to show elements stacked beneath your Flash movie and when actual transparency is needed.
  • I suggest folks use SWFobject (See also: UFO).
    Example using SWFobject with a wmode setting of opaque:
    Code:
    SWFobject resources: homepage, mailing list, list archives FORUM, and Why SWFobject is better than the rest.
  • UPDATE: UFO looks like a great (unobtrusive) alternative to SWFobject -- For more info, see "Related/interesting links" section below.
  • IMPORTANT: If you decide to manually embed your Flash object, remember to put the opaque (or transparent) code in both places:
    Code:
                                            wmode="opaque" ... >                    
  • ATTENTION! Safari users:

    I quickly slapped-together an example page, and tested Safari using these computers:
    • iBook g4 using OS 10.4 and Safari 2.0.4(419.3)
    • MacBook Intel OSX 10.4.8, using Safari 2.0.4(419.3)
    Although not perfect, it appears that Safari functions better using a wmode of "transparent".

    Unfortunately, this finding conflicts with the conclusion of this article: "... Yes, transparent mode will also allow your DHTML drop down menus to render properly and will hide non-essential Flash, but due to possible performance issues, that's best left for opaque mode. Use transparent mode to show elements stacked beneath your Flash movie and when actual transparency is needed."

    If you are not happy with how Safari handles wmode, see "Alternative fixes/hacks/workarounds" section below for a list of other possible solutions.
  • ATTENTION! Linux users:
    Quote: Will WMODE, or windowless mode, be supported with this release of Flash Player 9 for Linux?
    No, support for WMODE requires changes to the browser; Adobe is working with Mozilla to enable this functionality for Firefox. For more information and to track the issue, please see Bugzilla 137189.
    RESOLVED, see Bugzilla 137189.
Alternative fixes/hacks/workarounds:
  • iFrame shim:
    • Possible solution for Linux (and Safari? Other?) users.
    • To be considered a last resort solution.
    • iFrame shim example page.
    • Google: iFrame shim.
  • "Hide the flash object or select box when the menus open. I usually put a placeholder in for the object that is obstructing the menu so that the document flow doesn't change." -- Jordan West of Westward Web Development, via webdesign-L.com.
  • Avoid using "flyouts" completely.
  • Design a menu system that does not use "flyouts."
  • Design your site so that Flash does not interfere with crucial GUI elements like the navigation.
  • Accept the problem -- It is still somewhat usable, right?
  • "Build your navigation into the offending Flash piece" -- Andy W., via WSG listserv.
    Here is an example site: not a dropdown, but still good use of a Flash menu and swfObject -- view the source.
  • Use PHP/JS to browser sniff/dynamically change the wmode (transparent for Safari, and Opaque for all the rest.)
  • Other?
Adobe KB Technotes and FAQ:
  • Flash content displays on top of all DHTML layers
  • How to make a Flash movie with a transparent background
  • Flash OBJECT and EMBED tag attributes
  • Flash Player 9 Emerging Issues
  • Active content FAQ
Some other helpful threads:
  • "Click to Activate" solution! (AKA: Ugly Box problem)
  • did the windows update change how flash works?
  • force flash to play below dhtml menu?
  • Frequently Asked "Flash" Questions
Related/interesting links:
  • Unobtrusive Flash Objects (UFO)
    Quote: UFO is a DOM script that detects the Flash plug-in and embeds Flash objects (files with the .swf extension). It has its roots in the Web Standards community and is designed to support W3C standards compliant, accessible and search engine friendly web design. It also contains several features and best practice techniques that other scripts currently don't have.
    • An example using the UFO embedding method with wmode set to transparent, by Tony Crockford. (Browsercam) -- Thanks Tony!
  • Layering flash and html tutorial, by Nick Cowie.
  • Objecty
    Quote: Objecty makes it dead simple to put video and audio on the web. It's meant to re-swizzle the whole paradigm. (Or something.)
  • Update 06/27/07: MS Silverlight: Windowless Property. Hat tip: John Dowdell.
    Quote: Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of Microsoft .NET–based media experiences and rich interactive applications for the Web. -- Link
  • Update 06/28/07: Safari 3 Public Beta: "The world’s best browser. Now on Windows, too."
Related [deprecated?] topics:
  • Flash Satay: Embedding Flash While Supporting Standards. See also: Why SWFobject is better than the rest
  • Javay was another method, but I can not find a link (used to be in comments of ALA Satay article above)... still, swfObject is the best way to embed Flash (imho).
  • www.hillmancurtis.com embeds Flash like so:
    Code:
    And here is the js:
    Code:
    function RunFoo() {                    document.write('\n');                    document.write('\n');                    document.write('\n');                    document.write('\n');                    document.write('\n');                    }
    I think the above hillmancurtis method was the essence of the Javay method... though I can't fully remember.

    Edit:

    Original Javay ALA comment found here.
WMODE, a brief history:
Quote: Background: Towards IE4 or so, Microsoft introduced the ability to have browser extensions draw into the browser's own compositing buffer rather than directly to screen, enabling effects like layering and transparent backgrounds. Netscape Navigator followed with WMODE support a few years later, and now most browsers can accept plugin content as drawing inputs. -- John Dowdell, via webdesign-L.com. More tips/suggestions/corrections/additions are welcome.

Cheers,
Micky
Last edited by mhulse; Aug 10, 2007 at 10:30.   mhulse View Public Profile Visit mhulse's homepage! Find More Posts by mhulse