Forum Moderators: open
if (no.frame = 1) {
no.onPress = function(){
play();
no.gotoAndStop(2);
}}
if(no.frame = 2) {
no.onPress = function(){
stop();
no.gotoAndStop(1);
}}
But it doesn't quite work as expected when I preview it.
The button this is attached to fails to gotoAndStop at frame 2 of the mc and invokes the stop(); function when no.frame is one.
I suspect this needs to handled with an else if statement, but my attempts so far to create one produce 2 or 3 errors in the output dialog.
no.onPress = function(){
if (no.frame = 1) {
play();
no.gotoAndStop(2);
}
else {
if(no.frame = 2) {
no.gotoAndStop(1);
stop();
}
}}
The top statement is fully operational, including sending the no movieclip to frame 2 - but the bottom statement is being ignored.
There are no error messages.
I think it could be using an if in an else statement. I'm not certain this is allowable.
UPDATE: This is ignoring the conditions.
[edited by: GGR_Web at 12:58 pm (utc) on Feb. 18, 2009]