views:

1254

answers:

2

I think the question is pretty self explanatory. Anyone done this before?

UPDATE: Clarification on why I need to do this. We have a single swf behemoth of an AS1 - AS2 site with a large video gallery section. The client wants to update the video section as the AS2 code cannot handle their more recent, much larger, video files. The client will not pay for the entire site to be updated. So, I would like to be able to overlay an AS3 based video browser and player on the existing site when that section is navigated to, thus leaving the rest of the site working correctly with it's existing AS2 code.

Hope that explains things a little more clearly!

A: 

I'm guessing you are doing this so that people with an updated Flash will view the AS3 version and people with older Flash will only see the AS2 version, but you're making one big mistake:

You are punishing the people with update Flash because their browser will have to download both versions, which is very wasteful, especially if the AS2 version isn't small.

TravisO
Actually no. I'll clarify in the question...
defmeta
As stated, the plug-in version of Flash Player is independent of what swf is being played. As long as you have a Flayer Player 9+ you can playback AS3 swfs, otherwise, no go.
discorax
+3  A: 

I wouldn't think that whether it's AS3 or AS2 has anything to do with it.

From the point of view of the web browser, they are both a black box that says "Flash Player Plugin". You can only have one version of the plugin installed at one time, so even though you have an AS2 and an AS3 swf, the web browser just sees that it has 2 instances of "Flash player plugin version 10"

To boil it down what you seem to be trying to do is:

  1. Create a page:
  2. Stick a swf in it
  3. Add a div to the page and use CSS positioning to put it "over" the other swf
  4. Stick another swf in that div.

So, does this work? - No Yes, very well, but you must set wmode="transparent" on your embedded flash objects (thanks grapefrukt in comments).

I ran a test: here's my source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
    <head>
     <style type="text/css" media="screen">
      DIV{ width: 300px; height; 300px;}
      #background{ border: 1px solid green; background-color: green; z-index: 0; }
      #foreground{ border: 1px solid red; background-color: red; z-index: 50; }
     </style>
    </head>
    <body>
     <div id="background">
      <embed height="208" width="208" quality="high" bgcolor="#fff" src="bgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
     </div> 

     <div id="foreground" style="position: absolute; left: 30px; top: 30px;">
      <embed height="208" width="208" quality="high" bgcolor="#fff" src="fgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
     </div> 

    </body>
</html>

Results:

Without wmode=transparent, is inconsistent and minorly broken in firefox and IE. With it, does exactly what you think it should in both IE and firefox.
The swf files behave (from a layout point of view) as if they are just images. It's cool.

Orion Edwards
Set the bottom flash' wmode to transparent and it should work, worst case you may have to set both to transparent.
grapefrukt
Thanks ever so much Orion Edwards, and the ever helpful grapefrukt!
defmeta
video playback in wmode=transparent is a nightmare btw!
discorax