Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-27-2012, 05:31 PM   #1
tyronebiggums7795
Registered User
 
Join Date: Apr 2012
Posts: 9
Default How do you get a movieclip to do different animations based on keyboard input?

So I have my character, and I was wondering if there was a way to get him to do different animations based on keyboard input. Like if you press the right key it does the running animation, and if you press left then it just uses that same animation, and flips it. Also if the user presses space bar or something a jumping animation happens. I have all of these animations done in different parts of my characters timeline but don't know how to access different parts of the timeline. Does that make sense? I'm using Action Script 3.0, and Flash CS5.5. I'm pretty new so please be as explanatory as possible.
tyronebiggums7795 is offline   Reply With Quote
Old 04-27-2012, 09:39 PM   #2
rrh
throw a trace() in there
 
Join Date: Dec 2006
Posts: 1,982
Default

Some combination of gotoAndPlay, gotoAndStop and stage.addEventListener(KeyboardEvent.KEY_DOWN, someFunction);
rrh is offline   Reply With Quote
Old 04-29-2012, 03:05 AM   #3
xdeath
Deaths touch!!!
 
xdeath's Avatar
 
Join Date: Mar 2008
Posts: 776
Default

Quote:
Originally Posted by rrh View Post
Some combination of gotoAndPlay, gotoAndStop and stage.addEventListener(KeyboardEvent.KEY_DOWN, someFunction);
yes and from memory "mc.scaleX-=1" flips horizontally.
xdeath is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:23 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.