Background: I am making an isometric game using actionscript 2.0. Im a reasonably veteran coder, but I have very little experience in flash.
I was following the tutorial here in order to animate some character I had downloaded from old PS sprite sheets.
The structure of animation in the tutorial is:
-Create a base character movie clip.
-Double click char movie clip to open it up.
-Within this frame, each new keyframe will be a different animation: Essentially this frame is an animation directory for the rest of the animations.
-In order to create each of these animations, you open double click the frame that you want to animate, and once the new frame opens up, you add the additional sprites that actually animate the character (you are 3 levels in).
I am probably pretty terrible in explaining what he shows in the tutorial above. But my code isn’t working.
Its simple and as follows:
onClipEvent(load){dir=1;lastkey=0;movement=6;frameDelay=0;delayMax=40}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){this._x-=movement;this._y-=movement;this.gotoAndPlay("Squire_Walking_SW_Tag");dir=1;}
else if (Key.isDown(Key.LEFT)){this._x-=movement;this._y+=movement;this.gotoAndPlay("Squire_Walking_SW_Tag"); dir=2; }
else if (Key.isDown(Key.DOWN)){this._x+=movement;this._y+=movement;this.gotoAndPlay("Squire_Walking_SE_Tag"); dir=3; }
else if (Key.isDown(Key.RIGHT)){this._x+=movement;this._y-=movement;this.gotoAndPlay("Squire_Walking_SE_Tag"); dir=4;}
else if (dir==1){this.gotoAndPlay("Squire_Stand_NW_Tag")}
else if (dir==2){this.gotoAndPlay("Squire_Stand_SW_Tag")}
else if (dir==3){this.gotoAndPlay("Squire_Stand_SE_Tag")}
else if (dir==4){this.gotoAndPlay("Squire_Stand_NE_Tag")}
Problem: The gotoandplay tags are references to the starting frame for each animation. Unfortunately, when I hold down an arrow key when the movie is run. The character will move, but the animation is stuck in the first frame.
I assume that this is because every time the frame loads, it sends the animation back to the starting frame. Unfortunately I haven’t been able to find a way around it.