A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Nested Frames and gotoAndStop

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    4

    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."

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Maybe you can provide FLA file, didn't totally understand everything
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center