View Full Version : Resolved loaded swfs that can work together
I am working on something where I have a "manager" swf that loads other swfs into movieclips. I know they all have to be the same as flavor.
What I want to do is have "one.swf" tell "two.swf" to do something ie
function swftalk(evt:MouseEvent):void
{
two.swf.Myclip_mc.GotoAndPlay"frame2"
}
would that also work with button created in the manager swf?
Medyman
12-17-2008, 04:34 PM
I know they all have to be the same as flavor.
If you want to control the constituent SWF then you are correct. Otherwise, you can import an AS2 SWF into an AS3 document.
What I want to do is have "one.swf" tell "two.swf" to do something ie
Sure, it's easy. If you're importing two.swf into a movieclip called container, then you can use something like this:
function swftalk(evt:MouseEvent):void
{
container.Myclip_mc.GotoAndPlay"frame2"
}
Basically, treat the MC inside two.swf as if it were inside the container mc.
I got it to work with the code below. My manager code worked(above) fine for just importing swfs but didn't work with controlling them.
Next up can I import two swfs inside "manager.swf" and have a.swf control b.swf?
second attempt: I checked my code against the code on FlashandMath.com
for some reason the extra code does the trick and programatically generating the container works where as one placed on the stage does not.
if anyone can help me with the other problem I stated above let me know.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.