[font=verdana, arial, helvetica][size=2]if (abort eq “95743G29V8X0”) {
stop;
}
I have Flash MX 2004 Pro. I wanna make it so I can press the enter key on the keyboard when I type the code in to make my countdown stop.[/size][/font]
[font=verdana, arial, helvetica][size=2]if (abort eq “95743G29V8X0”) {
stop;
}
I have Flash MX 2004 Pro. I wanna make it so I can press the enter key on the keyboard when I type the code in to make my countdown stop.[/size][/font]
erm to run an action when your enter key is pressed, have this code (best on an onEnterFrame)
if(Key.isDown(Key.ENTER)){
//your actions here
}
Prophet.
PS for IF/ELSE mini tut, see here: http://www.kirupaforum.com/forums/showthread.php?p=608900&posted=1
That didn’t work. Heres what I did- if(Key.isDown(Key.ENTER))
//if(abort eq “95743G29V8X0”) }
stop();
I put that in but it didn’t work.
That didn’t work. Heres what I did- if(Key.isDown(Key.ENTER))
//if(abort eq “95743G29V8X0”) }
stop();
I put that in but it didn’t work.
:S
if(Key.isDown(Key.ENTER)) {
//if(abort eq “95743G29V8X0”)
stop();
}
You missed the opening bracket, and whats abort eq “95743G29V8X0”??
And I assume you want the stop(); within the conditin
Heres what I did I made a timer that counts down from 12, and I put the script if(abort eq “95743G29V8X0”) and the 95743G29V8X0 is an abort code its supposed to make the timer stop counting but it doesn’t.
if(Key.isDown(Key.ENTER)){
if (abort eq "95743G29V8X0") {
stop()
}
}
sorry, i guessed you would understand that
//
means its a comment and as such flash ignores these lines of code… the above should work… assuming your stopping an animation on the _root level and your original IF statement will equate to true…
Prophet.
I still don’t get it? Help me? Nothing works. It still won’t stop.
QUOTE=Prophet]
if(Key.isDown(Key.ENTER)){
if (abort eq "95743G29V8X0") {
stop()
}
}
sorry, i guessed you would understand that
//
means its a comment and as such flash ignores these lines of code… the above should work… assuming your stopping an animation on the _root level and your original IF statement will equate to true…
Prophet.[/QUOTE]
Could you please post your fla, we will just end up coming round in circles otherwise
The fla is too big.
I din’t quite understood what your timer whould be?
if ist’s a variable displayed with the help of getTimer(); you won’t be able to stop it with a stop(); action. That is for movieclips.
If you by timer were reffering to a movieclip then put this code on it
onClipEvent (enterFrame) {
if(Key.isDown(Key.ENTER)) {
if (abort eq "whatever") {
stop();
}
}
}
Or try using a listener
asdfg = new Object();
asdfg.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
trace("You pressed enter.");
if (abort eq "thatthingcode") {
stop();\\ i guess
}
}
};
Key.addListener(asdfg);
:: Copyright KIRUPA 2024 //--