Child > Parent >child preloading as3
I have been using:
yourbutton.addEventListener(MouseEvent.CLICK,f);
function f(e:Event):void{
Loader(this.parent).load(new URLRequest("newswf.swf"));
}
which was suggested to me in a different post to target the parent loader class, however i now no longer can reference my preloader in the parent swf
(extract from the parent swf):
var my_pb:ProgressBar = new ProgressBar();
my_pb.source = my_loader.contentLoaderInfo;
my_pb.x = 305;
my_pb.y = 293;
my_loader.load(new URLRequest("contentLoader.swf"));
this.mainTemplate.mcMaskedClip.addChild(my_pb);
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
function finishLoading(e:Event):void{
this.mainTemplate.mcMaskedClip.addChild(my_loader);
this.mainTemplate.mcMaskedClip.removeChild(my_pb);
}
How do i target the parent loader class to use the preloader?
the reason i need a pre loader are the swf files i am loading are fairly big i.e. 2-5mb
keith