Hey all,
I’m new to Flash and this forum. I’ve been scouring the internet through tutorials and guides but I still have a question about multiple key presses.
Here is my (noob) situation,
I made my character walk around using the directional keypad. Now I want my character to run by pressing shift and directional keypad. I have a different animation for run so I can’t just change the speed.
My main question is, how do I code two key presses to play an animation?
This is what I have,
var walkspeed:Number=5
var runspeed:Number=10
onEnterFrame=function(){
if(Key.isDown(Key.DOWN)){
_root.characterMc._y+=walkspeed;
_root.characterMc.gotoAndStop("characterWalkDown");
I tried to do,
if(Key.isDown(Key.DOWN) && Key.isDown(Key.SHIFT)){
_root.characterMc._y+=runspeed;
_root.characterMc.gotoAndStop("characterRunDown");
It didn’t work. I tried different variations of it but couldn’t get it. Is there a way to do it somewhat this way? If there is a better way, I’m open to new advice and direction but my knowledge of Flash is very limited. Also, I would like to know how to code two key presses at the same time so I can play different animations (not to just make a run button).
Thank you for your time.