A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: as3 Flash CC code? any keyboard event to advance playhead 1 frame at a time?????

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    11

    Question as3 Flash CC code? any keyboard event to advance playhead 1 frame at a time?????

    Can anyone point me in the right direction?
    I am trying to emulate a person typing in Flash CC. I had a code that would allow
    the user to hit any keyboard button and in turn advance one frame at a time per keystroke
    in order to appear as though they are typing the sentence in real time. The code no longer
    seems to be functional. Any help would be great, thnx.

  2. #2
    Member
    Join Date
    Apr 2014
    Posts
    63
    should just be a on key pressed nextFrame ... maybe paste your code

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I think you have asked this question in about 3-4 different places throughout the forum, Flash CC is AS3.
    PHP Code:
    stop();

    stage.addEventListener(KeyboardEvent.KEY_DOWNpressAnyKeyAdvanceButLeftGoBackward);
    stage.addEventListener(KeyboardEvent.KEY_UPresetKeyListener);

    function 
    pressAnyKeyAdvanceButLeftGoBackward(event:KeyboardEvent):void
    {
        
    stage.removeEventListener(KeyboardEvent.KEY_DOWNpressAnyKeyAdvanceButLeftGoBackward);
        switch (
    event.keyCode)
        {
            case 
    Keyboard.LEFT :
                
    prevFrame();
                break;

            default :
                
    nextFrame();
                break;
        }


    function 
    resetKeyListener(event:KeyboardEvent):void
    {
        
    stage.addEventListener(KeyboardEvent.KEY_DOWNpressAnyKeyAdvanceButLeftGoBackward);


Tags for this Thread

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