Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

movieclip control (for a beginner)

Status
Not open for further replies.

andagain

Technical User
May 28, 2004
25
GB
Hi - am rusty on Flash so this will be easy but I am getting a mess. Can you tell me the right way to do this. (please!)

I have 3 movieclips, and 3 buttons, all on main stage.
Each button plays a MC. What I'd like is that if button1 plays MC1 (which stops at end of its own timeline), when button2 is clicked MC2 plays, and MC1 plays in reverse back to its frame1.

I can get each MC to play on each corresponding button click, and I have used the code (below) I found from a tuturial to reverse a MC (not that I understand how it works..), but it means that once it has run once, when you click the same button to replay the MC for another time, it doesn't work.

What do I need to add to make this work? Or am I missing the point....is there an easier way to do this....? Do I need to update the stage or something...how do I do that?

*************

I have this in my MC action:

onClipEvent (load) {
stop ();
var speed = 1;
var direction;
}
onClipEvent (enterFrame) {
if (direction == "ff") {
gotoAndStop (_currentframe+speed);
} else if (direction == "rr") {
gotoAndStop (_currentframe-speed);
}

and this in my button onpress:

on (press) {
_root. MC1 .direction = "ff";
}
on (press) {
_root. MC1 .direction = "rr";
}

Thanks if you can help!

Andrew.
 
Are these 2 different buttons you're talking about above? Or the same button, which you would like to act as a toggle?
 
A toggle I think.
I'd like:

Button1 to play MC1
Button2 to play MC2 + play in reverse MC1 (or if reversing is too complex, just to hide MC1)
Button3 to play MC3 + play in reverse either MC1 or MC2, whichever may have been played before).

So yes, I'd like them all to act as toggles, toggling their own MC on, and another MC off if it has been played.

?
TIA

Andrew

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top