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!
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();
}
Copy link to clipboard
Copied
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();
}