I want when a button is pressed, it goes to play a certain frame(frame121) then when it reaches (frame130), it goes to play anotherframe. I have ten buttons but the problem is that all 10 buttons must play from frame 121 to frame 130 if it is pressed. And from that point on, each button if pressed will play different frame( let say button1 play frame 131, but2 play 140, but3 play151…) I juz can’t figure it ut how to do it. Any 1 pls help?
you could use a flag…
ie. in the button1 actions:
on (release) {
if (!flag) {
gotoAndPlay(121);
flag++;
} else {
gotoAndPlay(131);
}
}
=)
put the buttons on a separate layer and then hit insert frame on the last frame of your movie or wherever you want the buttons to end.
I think that is more of what you are looking for (but I have been wrong once or twice before)
good luck flashhead,
_root.brian2
I am quite new to flash.Is it that all i have to do is place the script on the button? Or do i have to make a “flag” how should i go about it?
*Originally posted by brian monkey *
**put the buttons on a separate layer and then hit insert frame on the last frame of your movie or wherever you want the buttons to end.
I think that is more of what you are looking for (but I have been wrong once or twice before)
good luck flashhead,
_root.brian2 **
I think u got it wrong. what i want is something like what kax has describe, but dun noe about the “flag” dinggy.
yeah… you use it as is.
the only thing you may need to change is rename the flag.
button1 actions:
on (release) {
if (!button1Flag) {
gotoAndPlay(121);
button1Flag++;
} else {
gotoAndPlay(131);
}
}
button2 actions:
on (release) {
if (!button2Flag) {
gotoAndPlay(121);
button2Flag++;
} else {
gotoAndPlay(131);
}
}
that should work…
And by the way my buttons are all on a differnt layer
hey man! try this one:
button1 action:
on (release) {
gotoThatFrame = 1;
gotoAndPlay(121);
}
button2 action:
on (release) {
gotoThatFrame = 2;
gotoAndPlay(121);
}
and so on…
3. on frame 130, put this code:
ifFrameLoaded(1) {
if (gotoThatFrame==1) {
gotoAndPlay whatever u like…
}
if (gotoThatFrame==2) {
gotoAndPlay whatever u like…
}
if {
…continue until gotoThatFrame == 10
}
}
5. That’s it!
*Originally posted by kax *
**yeah… you use it as is.
the only thing you may need to change is rename the flag.
button1 actions:
on (release) {
if (!button1Flag) {
gotoAndPlay(121);
button1Flag++;
} else {
gotoAndPlay(131);
}
}
button2 actions:
on (release) {
if (!button2Flag) {
gotoAndPlay(121);
button2Flag++;
} else {
gotoAndPlay(131);
}
}
that should work… **
Cannot work.
When release, for the 1 button, it works fine but not for the others. They juz play the frame 131 to 140. But i dun want it to play 131 to 140 for the rest of the buttons.
hey man! try this one:
button1 action:
on (release) {
gotoThatFrame = 1;
gotoAndPlay(121);
}
button2 action:
on (release) {
gotoThatFrame = 2;
gotoAndPlay(121);
}
and so on…
3. on frame 130, put this code:
ifFrameLoaded(1) {
if (gotoThatFrame==1) {
gotoAndPlay whatever u like…
}
if (gotoThatFrame==2) {
gotoAndPlay whatever u like…
}
if {
…continue until gotoThatFrame == 10
}
}
5. That’s it!
*Originally posted by rvanet *
**hey man! try this one:
button1 action:
on (release) {
gotoThatFrame = 1;
gotoAndPlay(121);
}
button2 action:
on (release) {
gotoThatFrame = 2;
gotoAndPlay(121);
}
and so on…
3. on frame 130, put this code:
ifFrameLoaded(1) {
if (gotoThatFrame==1) {
gotoAndPlay whatever u like…
}
if (gotoThatFrame==2) {
gotoAndPlay whatever u like…
}
if {
…continue until gotoThatFrame == 10
}
}
5. That’s it! **
THAT’S IT MY FRIEND YOU ARE AMAZING!!!
THX!!!
No problem! :thumb:
Cheers!