Stick Page Forums Archive

Actionscript 2, code not working.

Started by: CustomWeapon | Replies: 6 | Views: 901

CustomWeapon
2

Posts: 26
Joined: Mar 2012
Rep: 10

View Profile
Mar 31, 2012 4:01 PM #625209
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?
Scarecrow
2

Posts: 9,168
Joined: Oct 2005
Rep: 10

View Profile
Apr 1, 2012 1:28 AM #625530
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.
CustomWeapon
2

Posts: 26
Joined: Mar 2012
Rep: 10

View Profile
Apr 2, 2012 9:53 AM #626349
Quote from Scarecrow
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. :(
Zed
2

Posts: 11,572
Joined: Feb 2009
Rep: 10

View Profile
Apr 2, 2012 10:07 AM #626356
Is "40" actually a key which can be down?
CustomWeapon
2

Posts: 26
Joined: Mar 2012
Rep: 10

View Profile
Apr 2, 2012 11:43 AM #626409
Quote from Zed
Is "40" actually a key which can be down?

40 is the down key according to THIIIIS that someone gave me.
Chimaera
2

Posts: 2,490
Joined: Oct 2005
Rep: 10

View Profile
Apr 2, 2012 12:09 PM #626419
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?
CustomWeapon
2

Posts: 26
Joined: Mar 2012
Rep: 10

View Profile
Apr 3, 2012 11:15 AM #627016
Quote from Chimaera
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
Website Version: 1.0.4
© 2025 Max Games. All rights reserved.