I have a game i am making and there is one thing i cant find any where how to make a in game button change the speed var in my guy any help would be greatly apreciated
First, AS2 or AS3? Second, that's extremely basic, just make an onclick event and have the var equal the new speed. If your var was called speed, it will look like this
//Now we gonna define the KeysDown function function keysDown(e:KeyboardEvent):void{ //Check if the keyCode is pressed if(e.keyCode=="keyCode number"{ speed="Your value"; } //Optional, trace the keyCode of the key you press trace(e.keyCode); }
hey guys im using as2 and im newish to the whole concept of as i may be writing it wrong but it didn't work the instance name of my character is player and the speed line is... var speed:Number = 10; if u could type the code u think it may be plz do it would help tones thx again