• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Participant ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

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!

Views

151

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Dec 13, 2018 Dec 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();

}

Votes

Translate

Translate
Participant ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

LATEST

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();

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines