At 3/14/13 04:42 PM, voter96 wrote:
At 3/14/13 04:30 PM, GeoKureli wrote:
only if you want roatateStage to be called once. it seems like you want it to be called every frame
or like this?:
stage.addEventListener(Event.ADDED_TO_STAGE, pressKey, releaseKey);
those functions are key listeners, and you can't pass 2 at once
You're confusing events, here's a reference guide to events
Event.ADDED_TO_STAGE: gets called when the object gets added to the display list so this would be called if you said
addChild(myObj); if myObj has an ADDED_TO_STAGE event, this would trigger it.
Event.ENTER_FRAME: gets called every frame, commonly used for an update function
KeyboardEvent.KEY_DOWN: usually applied like so: stage.addEventListener(KeyboardEvent.KEY_DOWN, myFunc), so that myFunc() gets called whenever a key is pressed
KeybooardEvent.KEY_UP: same as key down, but when a key is released.
these are your tools, use them wisely, and seriously try googling "as3 events for beginners"