A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: A little help

  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    1

    A little help

    Hello everyone. I'm new to AS2 but I'm in the middle of designing a game. I've used the website to get some code; but it doensn't always work and I don't want to bump the thread. I'm using a listener when the Enter key is hit to go to the next frame; but that applies to every frame, not just one.
    Code:
    stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);
    
    private function onKeyUpHandler(event : KeyboardEvent) : void
    {
        switch(event.keyCode)
        {
            case Keyboard.ENTER:
                nextFrame(10);
                break;
        }
    }
    and when the animation for a character is done playing, I want to go to the next frame on the timeline; which also doesn't work.
    Here's a video; can you tell me what I'm doing wrong.

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    is this for a 'class' or something?

    Im not 100% clear on what it is you even want to do?


    If you put a listener on the ENTER key.. that says when pressed.. go to next frame.

    That what it will do, each time it is pressed. (unless you remove the listener form the ENTER key)

    I also do NOT think the nextFrame() function can take any arguments/parameters (ie: the 10 you have in there)

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