Actionscript 2, code not working.
Started by: CustomWeapon | Replies: 6 | Views: 901
CustomWeapon2Posts: 26
Joined: Mar 2012
Rep: 10
View Profile Okay, vauge title as it may be imma hope to get some help here!
onClipEvent (enterFrame) {
if (Key.isDown(40)) {
gotoAndPlay(351);
}
}
I'm pretty sure I'm going wrong on the first line but I have no idea what or how to change it. Advice?
Scarecrow2Posts: 9,168
Joined: Oct 2005
Rep: 10
View Profile try
onClipEvent(enterFrame) {
if(Key.isDown(40)) {
gotoAndPlay(351);
}
}
spaces in between your functions and brackets may be causing problems. does it throw an error, or just not work? my coding is a little rusty and i'm only just reinstalling flash now, but if this doesn't work for you i'll have a more proper look at it next time i see this thread.
CustomWeapon2Posts: 26
Joined: Mar 2012
Rep: 10
View Profile try
onClipEvent(enterFrame) {
if(Key.isDown(40)) {
gotoAndPlay(351);
}
}
spaces in between your functions and brackets may be causing problems. does it throw an error, or just not work? my coding is a little rusty and i'm only just reinstalling flash now, but if this doesn't work for you i'll have a more proper look at it next time i see this thread.
Nope I'm still not getting anything. :(
Zed2Posts: 11,572
Joined: Feb 2009
Rep: 10
View Profile Is "40" actually a key which can be down?
CustomWeapon2Posts: 26
Joined: Mar 2012
Rep: 10
View Profile Is "40" actually a key which can be down?
40 is the down key according to
THIIIIS that someone gave me.
Chimaera2Posts: 2,490
Joined: Oct 2005
Rep: 10
View Profile 40 is the down key... No idea why it's not working... syntax is right from what I can see; try using logical or (" || ") to define an alternate key, preferably a letter and see if that works.
EDIT// The code is inside the MovieClip right?
CustomWeapon2Posts: 26
Joined: Mar 2012
Rep: 10
View Profile 40 is the down key... No idea why it's not working... syntax is right from what I can see; try using logical or (" || ") to define an alternate key, preferably a letter and see if that works.
EDIT// The code is inside the MovieClip right?
Yeah it is xD and Uh I have no idea what that even means. I'm a total noob at ActionScript.
EDIT: Thanks to Malfunction on the IRC
onClipEvent(enterFrame) {
if(Key.isDown(40)) {
_root.gotoAndPlay(420)
}
}
It was refering to itself lol