PDA

View Full Version : Separate Interconnected Flash .swf files




Mr. Anderson
Sep 19, 2005, 10:30 AM
So on the cnn home page right now, is an add for a razor, but its actually three separate .swf files. In the pic - 1, 2 and 3. If you click swing in 1, the guy hits the golf ball, it flies through 2 and lands in 3.

So does anyone know how they're sending the info to the different .swf files to have it trigger the correct scene in the right order?

Thanks,

D



iMeowbot
Sep 19, 2005, 04:07 PM
Most likely it's the LocalConnection (http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16243) stuff. (I notice that the keyboard seems to act a little goofy in their example, try pasting text)

clayj
Sep 19, 2005, 04:12 PM
It's also possible for one SWF file to use a GoToandPlay command to tell another SWF file what to do... the way my Flash site works, there's a substrate Flash file (Main.swf) which loads into level 0, and which remains in place the entire time. All other SWF files load on top of level 0, in specific predetermined levels. So, an SWF file in one level (say, level 4) can send a message (GoToandPlay) to an SWF file in a different level (say, level 5) and make that SWF file do something... in this case, "continue" the animation of the golf ball by playing a particular sub-movie or sequence of frames.

Mr. Anderson
Sep 19, 2005, 04:20 PM
I think that local connection is what they used - cool stuff. Is that in MX 2004 or the newest version?

clayj - that works in the single flash object on your page - layers in the same main file. What local connection is doing is having two or more separate flash objects on a page among regular html text and images and communicating between them.

D

clayj
Sep 19, 2005, 05:00 PM
I think that local connection is what they used - cool stuff. Is that in MX 2004 or the newest version?

clayj - that works in the single flash object on your page - layers in the same main file. What local connection is doing is having two or more separate flash objects on a page among regular html text and images and communicating between them.

DActually, I'm not talking about layers in the same SWF file... I'm talking about many different SWF files (my site has over 600 of them) all sending messages at each other telling each other what to do.

Now, as far as that particular page goes, assuming that they're not loading all of the SWF files on top of a common "layer 0" SWF file like I am, then yes, the local connection thing would be the way to go.

iMeowbot
Sep 20, 2005, 12:13 AM
I think that local connection is what they used - cool stuff. Is that in MX 2004 or the newest version?
It's been there a while, probably the first MX (6) release.