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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timed Button (Waiting)??

Status
Not open for further replies.

alokwww

Technical User
Dec 25, 2002
86
Hi,
I have a movie in which there are a few buttons.
Heres how its built:
I have all the buttons on one layer.
I have all the text on one layer.
I have the transition on one layer.
Anytime someone clicks a button, I have faderMC, which is the transition movie clip, gotoandplay(2).
In addition to having the button play faderMC, I want it to check on the progress of faderMC, and when faderMC reaches frame 30, I want to have the main movie gotoandstop on frame 70, if that makes sense.

Basically, when someone clicks the following should happen:
1. faderMC plays
2. check to see if faderMC if faderMC has reached frame 30
3. if faderMC has reached frame 30, the main movie goes to frame 70

This is all I have so far:

on (release) {
faderMC.gotoandplay(2)
}

and then I need something along the lines of
if (faderMC.frames.30) {
gotoandstop(70)
}
but it needs to make sense, lol.

Any help would be greatly appreciated!
Thanks!
-Alok Wadhwani
 
Assuming faderMC is on the main timeline, you could try something like this...

Create an empty movie clip, drag it on stage, and apply this code to it...
Code:
onClipEvent(enterFrame){
    if (_root.faderMC._currentframe >=29) {
        _root.gotoAndStop(70);
    }
}

But using a frame number might be error prone... You should maybe use a frame label instead. Thus label frame 70 with an unique label (no number only labels, or at least not starting off with a number) such as frame_70, and target that labeled frame...

Code:
onClipEvent(enterFrame){
    if (_root.faderMC._currentframe >=29) {
        _root.gotoAndStop("frame_70");
    }
}

Don't forget the double quotes on the goto action.

Regards,

cubalibre2.gif
 
Rather than applying the above code on the "control" movie clip, you could also put the following code on the first frame inside that empty movie clip...
Code:
this.onEnterFrame = function() {
    if (_root.faderMC._currentframe >=29) {
        _root.gotoAndStop("frame_70");
        delete this.onEnterFrame;
    }
};

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top