I’m successfully adding an external .swf file using the following code:
import flash.display.Loader;
import flash.net.URLRequest;
var request:URLRequest=new URLRequest("graphic.swf");
var myLoader:Loader = new Loader();
myLoader.load(request);
topClip.addChild(myLoader);
So - I’m loading the “graphic.swf” into a movie clip called “topClip” which is already on the stage in the main timeline. That works fine.
But… then I’m having a problem addressing the loaded “graphic.swf” with a button (to lower it’s alpha). I’m using this:
btn_exit.addEventListener(MouseEvent.CLICK, lower);
function lower(e:Event):void{
topClip.myLoader.alpha=.2;
}
So - something must be wrong with my syntax to address the clip “topClip.myLoader.alpha”… Perhaps I need to cast it somehow? Not sure.
Any help would be appreciated.
Thanks,
- Brian