First let me say I’m relatively new to AS 3 and I’ve scoured the Internet looking for a simple solution to no avail.
Here’s my general situation:
- I have dragged a movieclip with an instance name of a_mc onto the stage.
- On the first frame of the timeline I am importing a class file and calling its constructor:
import cardmaker.*;
var coverMaker:CoverMaker = new CoverMaker();
I was under the impression that since the movieclip (a_mc) is already on the stage that I could target it from within the constructor function just by name, however, I always get a “1120: Access of undefined property a_mc”
Simplified Class:
package cardmaker {
import flash.display.*;
public class CoverMaker extends MovieClip {
public function CoverMaker():void {
a_mc.gotoAndStop('on');
}
}
}
With this problem in mind, is it “better” to just dynamically position every Library object on the stage instead of dragging them manually? If so, what is the benefit?
Thanks!