FORUMS: list search recent posts

Flash KeyListner or Advance Function

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matt Ooley
Flash KeyListner or Advance Function
on Jun 15, 2009 at 4:29:39 pm

I am looking for a way to advance a Flash presentation by using the right and left arrow keys. I'm assuming I need a key listener, but I cannot seem to get the code to work correctly.

Basically, the code needs to make the flash movie advance to next frame/previous frame on press of the left/right key.

Any help would be greatly appreciated.

Thanks,

Matt


Return to posts index

demetri tashie
Re: Flash KeyListner or Advance Function
on Jun 15, 2009 at 7:38:19 pm

huh ?
Matt Ooley == Michael Wilfong ?
Clarke Kent == Superman ?? ???

here's simple code that will do that - basically you add the event listenr to the stage to hear the keyboard event:
stop();

stage.addEventListener(KeyboardEvent.KEY_DOWN, myFunction);

function myFunction(event:KeyboardEvent):void {

if (event.keyCode==Keyboard.LEFT) {prevFrame() }
if (event.keyCode==Keyboard.RIGHT) {nextFrame() }



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]