How to play looping animation in ActionScript through certain range of frames?
I have to do a project for college where a character is placed in the scene and has a walking animation for left and right as well as some others. All of the animations are contained within the character symbol. I'm trying to get it so that when the character is moving it plays from the correct frame and then loops back to that frame when it reaches the end of that specific animation (e.g walkRight_Start to walkRight_End), but using goToAndPlay I can only get it to start at the correct frame and then play through all of the frames instead of stopping and going back to the start once it reaches the frame I want.
I tried fixing this by having this code in an enter frame event:
function character_enterFrameHandler(event: Event):void
{
if (characterMoving_Right == true)
{
if (character.currentFrame <= "rightWalk_End")
{
character.nextFrame();
}
else
{
character.gotoAndStop("rightWalk_Start");
}
}
}
but it won't work; the character just plays the animation once and then stops? Does anyone know how to fix this problem? Thanks
