all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

spacebar/arrows interact


spacebar/arrows interact homegrownideas
9/12/2004 8:30:20 PM
flash actionscript:
I am working on creating a game in flash mx and I was wondering about the
actionscripts you would use to make a symbol move. For example: you make the
symbol shoot using spacebar and move left by the left arrow.
Re: spacebar/arrows interact hackysack
9/12/2004 9:36:35 PM
on(keyPress "<Left>")
on(keyPress "<Right>")
on(keyPress "<Space>")

Re: spacebar/arrows interact mandingo
9/12/2004 11:51:56 PM
hmmm where do you intend to put that code... for smoother interaction, you
might need it to be on the character object that is shooting and moving...

this.onEnterFrame = function(){
if(Key.isDown(Key.SPACE)){
// shoot;
}
if(Key.isDown(Key.LEFT)){
// move Left
}
if(Key.isDown(Key.RIGHT)){
// move Right;
}
}

I hope that helps,
cheers,
AddThis Social Bookmark Button