Adobe flash cs4 Game tutorial: Character Movement and Animation
Top Comments
All Comments (233)
-
hero.gotoAndStop('still');
var Key:KeyObject = new KeyObject(stage);
stage.addEventListener(Event.E
NTER_FRAME, onenter); function onenter(e:Event) :void{ if (Key.isDown(Key.RIGHT)){ hero.x+=2; hero.scaleX=1; hero.gotoAndStop('walking'); } if (Key.isDown(Key.LEFT)){ hero.x-=2; hero.scaleX=-1; hero.gotoAndStop('walking'); }else{ hero.gotoAndStop('still'); }
}
-
Hang on, where does the KeyObject script we downloaded go?
-
You should like Josh of the howstuffworks podcast haha.
-
Thank you, sir. You were entirely helpful.
-
thx so much!! but where the second part?
-
wow actionscript stole my strawberry tart
-
I can never succeed with these tutorials. I find them hard to follow. I have done everything to what you said and it saying things like. goToAndStop is not a function (player1.goToandStop("stand"); it wont alow it. And I also dont know how import KeyObject is done from the flash file. I ave it in same directtory.........
-
thanks honey
-
thank you
-
what did he do between when he said something about the red flaigs and the content layer?
What if your running animation has 5 frames and you want it to action through them as you walk left or right.
=]
dragonvl 1 year ago 7
To all that gets the hero stuck on the first pose when he's supposed to be walking: After hours of googling I finally found a forumpost with the solution! YouTube won't let me post a link, but Google this: "[AS3] movieclip doesn't play when holding arrow keys down" and you should find the same forumpost I did, with the solution. GL.
1Thir13teen3 10 months ago 2