Does anyone know if it’s possible to link a MovieClip on the stage to a class?
I have a MovieClip on the stage called: square_mc
and I have this Move class (see attached code).
Of course when I set the class linkage of square_mc to the Move class, square_mc moves down the screen, Move is working. But how would I attach the Move class to square_mc at runtime, when it’s on the stage?
Thanks!
Attach Code
package {
import flash.display.MovieClip;
import flash.events.Event;
//
public class Move extends MovieClip {
//
public function Move () {
trace (“Move”);
this.addEventListener(Event.ENTER_FRAME, moveSquare);
}
//
private function moveSquare (event:Event) {
this.y += 1;
}
}
}