Attach a movieclip from the main timeline inside another movieclip.
I need help with the game I am working currently. On the main timeline Actions frame I have a loader class called myLoader. I attached that to a movieclip called currentSWF. I have a movieclip called SpinningCard in the library which I dynamically attached to the stage. Inside the SpinningCard movieclip there is another movieclip Card. In the Card movieclip I have 10 frames and on each frame I want to attach a different instance of the movieclip currentSWF. How can I do achieve that?
here's what I have till now...
On the main timeline Actions frame...
var loader:Loader=new Loader();
loader.load(new URLRequest("CardGraphics.swf"))
var currentSWF:MovieClip;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
function swfLoaded(e:Event):void {
currentSWF = MovieClip(loader.contentLoaderInfo.content);
addChild(currentSWF);
}
Inside the Card movieclip on the first frame I have this code...
var a1:MovieClip = MovieClip(parent.parent.getChildByName('currentSWF'));
CardFrame1.addChild(a1);
//CardFrame1 is an empty movieclip which is there on the frame 1 of Card Moveiclip.
I am getting error : Parameter must be non-null. How can I solve. Can anyone please help me.