Skip to main content
Inspiring
December 13, 2018
Answered

Interactive keystrokes to advance 1 keyframe at a time in the timeline for playback

  • December 13, 2018
  • 1 reply
  • 277 views

Hello,

I'm trying to simulate typing using a series of keyframes in the the timeline.  The idea being that when the user 'types' or keys the A-Z keys, the timeline advances +1 frames for each keystroke.

I've imported my frames to the timeline and chosen "Distribute to keyframes".  I'm looking for ActionScript help to get the interactivity working?

Additionally, I don't see a good way to get script to each keyframe other than copy/pasting AS3 to 1 frame at a time.  I know there's a better way to do this part?

Thanks in advance for your help with this!

This topic has been closed for replies.
Correct answer MadrikMedia

I was able to answer my own question... sharing my solution below:

I added the following script to the first keyframe of my single layer multiframe animation:

stop();

stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);

function fl_KeyboardDownHandler(event:KeyboardEvent):void

{

nextFrame();

}

1 reply

MadrikMediaAuthorCorrect answer
Inspiring
December 13, 2018

I was able to answer my own question... sharing my solution below:

I added the following script to the first keyframe of my single layer multiframe animation:

stop();

stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);

function fl_KeyboardDownHandler(event:KeyboardEvent):void

{

nextFrame();

}