ok its probabli kinda complicated to explain but does anyone know actionscript for a button like
on (release) {
if frame = 10
gotoAndStop(..) if else gotoAndStop(..)
}
ok its probabli kinda complicated to explain but does anyone know actionscript for a button like
on (release) {
if frame = 10
gotoAndStop(..) if else gotoAndStop(..)
}
for a button the AS is
on(release) {
//stuff happens
}
or
on(press) {
//stuff happens
}
Since you had gotoAndStop(..) I'm assuming you want the button to make a movieClip goto and stop on a certain frame, so the as would be something like:
on(release) {
_root.movieclipname.gotoAndStop(5);
//replace movieclipname with the movieclipname and 5 with whatever frame number you want it to stop on.
}
At 8/11/06 02:14 AM, Zeramas wrote: ok its probabli kinda complicated to explain but does anyone know actionscript for a button like
on (release) {
if frame = 10
gotoAndStop(..) if else gotoAndStop(..)
}
on(release){
this._currentframe == 10 ? gotoAndStop(frame if true) : gotoAndStop(frame if false);
}
if you don't like conditionals, then use this code, but I suggest using the first method.
on(release){
if(this._currentframe == 10){
gotoAndStop(...);
}
else {
gotoAndStop(...);
}
yea but i want like the if statement in
like a basic soccer shotout and and goalie is a mc and goes to a rondom frame when u click and if u click the top left and the goalie goes there on one of the frames they wuld
colide and if he dived the other way it wuld go in
on(release) {
if(goalie._currentFrame == 5) {
gotoAndPlay("score");
} else if (goalie._currentFrame == 10) {
gotoAndPlay("block");
}
}
Like that?