|
-
Nested Frames and gotoAndStop
I have a very specific AS2 parent/child movie clip issue, if anyone here can help out.
I have a main Character movie clip which contains as nested frames each profile of the Character (front,back,left,etc). Within each of these child profile MC frames, animations for those profiles are further nested in frames.
Then, essentially I have movement code as part of the key listener:
Code:
switch(Key.getCode())
{
case 87:
Character._y -= 10;
Character.gotoAndStop('Back');
Character.gotoAndStop('walk');
break;
case 83:
Character._y += 15;
Character.gotoAndStop('Front');
Character.Front.gotoAndStop('walk');
break;
case 65:
Character._x -= 10;
Character.gotoAndStop('Left');
break;
case 68:
Character._x += 10;
Character.gotoAndStop('Right');
break;
}
And later code to reset to the character's resting frame after key release:
Code:
switch(Character._currentFrame)
{
case 5:
Character.gotoAndStop('Back');
break;
case 1:
Character.gotoAndStop('Front');
break;
}
The problem is that when I try to Character.gotoAndStop('Front'); after key release, flash thinks, you're already on the Front frame (because the walk animation is a child of that MC and is already playing). Therefore the walk animation just keeps playing after the key has been released.
Is there an easy, one-off way to fix this?
Thanks in advance for any help.
"You will eat Sauer Kraut... And like it."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|