I need a class code to access a child instance of another class code that is on the stage. I have a class code named Ball.as. On the Time Line is a child of the Thing class. It is call newThing. Here is the code in the Ball.as file:
package {
import flash.display.MovieClip;
import flash.events.*;
public dynamic class Ball extends MovieClip {
private var _root:Object;
public function Ball() {
addEventListener(Event.ADDED, beginClass);
addEventListener(Event.ENTER_FRAME, eFrame);
}
private function beginClass(event:Event):void {
_root=MovieClip(root);
this.x=newThing.x;
this.y=newThing.y;
}
private function eFrame(event:Event):void {
// do stuff
}
}
}
I get an error message saying that newThing is an undefined property. Please help me out. I’ve been trying to figure this out for weeks with no luck. Thanks in advance.