I have a MovieClip object on the stage called mcTest with an associated class “TestMC”. mcTest has 5 frames with a different named Sprite on each one of the frames, let’s call them s1, s2, s3, s4, s5.
In the class file for TestMC, I declare:
public var s1:Sprite;
…
public var s5:Sprite;
If I don’t declare them, I, of course, get a “can’t create displayobject” error when I play the movieclip. But when I do declare them, their value is null, even if I do this code in the TestMC constructor:
public function TestMC()
{
this.gotoAndPlay(3);
trace("sc3:"+sc3); // prints: "sc3:null"
}
I need to save and store the coordinates (x,y) of sc3 in the constructor, and then removeChild(sc3). Ideas?
Similarly, is it possible to addChild() to a specific frame/key frame rather than addChild to the entire timeline of the MovieClip?
Thanks,
~JC