Copy link to clipboard
Copied
Hi,
The following code works fine but always this external .SWF file stays on Top ot other Layers. How can I bring it down to the desired level (Say, if I have 10 layers and I would like this external .SWF on 5th layer).
var mySwf1:SWFLoader = new SWFLoader("AnalogClock.swf", {width:225, height:225, container:this, onComplete:completeHandler1});
mySwf1.load();
function completeHandler1(event:LoaderEvent):void {
TweenLite.to(event.target.content, 0,{alpha:0});
TweenMax.fromTo(event.target.content, 2, {x:225, y:-500, width:225, height:225, alpha:.5}, {x:225, y:300, width:225, height:225, alpha:1, delay:1, ease:Strong.easeOut});
}
TweenLite.delayedCall(20, mySwf1.unload)
Thanks.
Copy link to clipboard
Copied
your SWFLoader class probably has an addChild method (eg, someObj.container.addChild(whatever) ) that you can exchange for addChildAt() in the class or you can use:
this.addChildAt()
elsewhere in your code after finding what's returned in SWFLoader.
Copy link to clipboard
Copied
Hi,
Please help me in the following code:
How to modify the above code to suit my requirement? My external .SWF File name is "AnalogClock.swf".
Regards.
Copy link to clipboard
Copied
it's your loader's name that matters, not the swf name. unless the code in SWFLoader does something stupid like add the loader's content to the display list instead of adding the loader.
Copy link to clipboard
Copied
Hi,
I am using the greensock loader to load my AnalogClock.swf.
import com.greensock.loading.LoaderMax;
import com.greensock.loading.SWFLoader;
Please advise.
Regards.
Copy link to clipboard
Copied
i don't know anything about the gs loader. but he's a pretty good coder so you can probably see the loader's name in SWFloader's constructor.
Copy link to clipboard
Copied
Thanks for the reply. Is there any sample code (other than greensock "gs" for achieving the same using the Flash CS4 pro
Regards.
Copy link to clipboard
Copied
i don't see any point ot using SWFLoader. even though i don't know what it does, from the data your passing to the constructor, it can't do much. use:
var mySwf1:Loader = new Loader(new URLRequest("AnalogClock.swf"));
mySwf1.contentLoaderInfo(addEventListener.COMPLETE,completeHandler1);
mySwf1.load();
function completeHandler1(event:LoaderEvent):void {
this.addChildAt(event.target,0); // even if you continue to use SWFLoader, you can use this line to add your loader to the lowest depth
TweenLite.to(event.target, 0,{alpha:0});
TweenMax.fromTo(event.target, 2, {x:225, y:-500, width:225, height:225, alpha:.5}, {x:225, y:300, width:225, height:225, alpha:1, delay:1, ease:Strong.easeOut});
}
TweenLite.delayedCall(20, mySwf1.unload)