Hi, I'm trying to use reverseFrames() on my MC. But the effect is strange. I've made videos to show what I mean.
The animation is of a concert stage light moving left and right all the time.
This is correct animation - I need to use enter frame function and reverse frames manually:
https://streamable.com/t14mh
This is function which works fine:
mc.addEventListener(Event.ENTER_FRAME,enterFrame);
private var goFront:Boolean = false;
private function enterFrame(e:Event):void {
var mc:MovieClip = e.target as MovieClip;
if (mc.currentFrame == mc.numFrames - 1 || mc.currentFrame == 0) goFront = !goFront;
if (goFront) mc.currentFrame ++;
else mc.currentFrame --;
}
This is bad effect when I use reverseFrames() https://streamable.com/zyday
As you can see the object changes it's x position.
mc.addEventListener(Event.COMPLETE,comp);
private function comp(e:Event):void {
var mc:MovieClip = e.target as MovieClip;
mc.reverseFrames();
}
So reversing frames within enterFrame() function gives diffrent effect than using reverseFrames() function. Does the reverseFrames() function works all right? Or should I do anything else with reverseFrames() function to have the correct effect?