runtime
05-17-2008, 03:11 AM
Hello,
I have a chopper_mc that is being controlled by the arrow keys. it basically flips one direction or another.
another mask_mc is always following it by being repositioned behind it when it flips. because the user can move the mc around i need a frame event so that it constantly updates x and y based on the position of chopper_mc.
It works fine on Frame 1, then fine again on frame 2. but when the user makes chopper_mc go back to frame 1 it seems that the spotChaseChopperR function takes over and it wont go back and forth.
is there any way to remove a frame event? or is there a better way to remove it?
frame 1:
stop();
function spotChaseChopperL(evt:Event):void {
MovieClip(root).mask_mc.x = Number(MovieClip(root).chopper_mc.x + 100);
MovieClip(root).mask_mc.y = Number(MovieClip(root).chopper_mc.y + 100);
}
addEventListener(Event.ENTER_FRAME, spotChaseChopperL); //
frame 2:
stop();
function spotChaseChopperR(evt:Event):void {
MovieClip(root).mask_mc.x = Number(MovieClip(root).chopper_mc.x -200);
MovieClip(root).mask_mc.y = Number(MovieClip(root).chopper_mc.y + 100);
}
addEventListener(Event.ENTER_FRAME, spotChaseChopperR);
Any help is appreciated in advance!
I have a chopper_mc that is being controlled by the arrow keys. it basically flips one direction or another.
another mask_mc is always following it by being repositioned behind it when it flips. because the user can move the mc around i need a frame event so that it constantly updates x and y based on the position of chopper_mc.
It works fine on Frame 1, then fine again on frame 2. but when the user makes chopper_mc go back to frame 1 it seems that the spotChaseChopperR function takes over and it wont go back and forth.
is there any way to remove a frame event? or is there a better way to remove it?
frame 1:
stop();
function spotChaseChopperL(evt:Event):void {
MovieClip(root).mask_mc.x = Number(MovieClip(root).chopper_mc.x + 100);
MovieClip(root).mask_mc.y = Number(MovieClip(root).chopper_mc.y + 100);
}
addEventListener(Event.ENTER_FRAME, spotChaseChopperL); //
frame 2:
stop();
function spotChaseChopperR(evt:Event):void {
MovieClip(root).mask_mc.x = Number(MovieClip(root).chopper_mc.x -200);
MovieClip(root).mask_mc.y = Number(MovieClip(root).chopper_mc.y + 100);
}
addEventListener(Event.ENTER_FRAME, spotChaseChopperR);
Any help is appreciated in advance!