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

short question 1

Status
Not open for further replies.

Illreap33

Vendor
Sep 22, 2003
9
CA
I have a series of buttons and I want them when clicked to load another swf and go directly to a particular frame.

I can load the files but only to make them start on frame 1 which I dont want.
 
An external .swf only exists when it's fully loaded, so you basically can't tell it to go to one specific frame, if that frame doesn't exist yet, and certainely not on the same script as the loadMovie action itself, at least on the initial load!
Thus you can either tell it to go to a specific frame, a few frames later than your loadMovie action itself, or set a variable on your button press, which will be checked by the to be loaded movie, and re-direct it to the proper frame.
In any case, your to be loaded movie, once loaded, should be looping on it's first 2 blank keyframes and checking for that variable that was set on the button press.
Suggest you use frame labels rather than frame numbers which are more error prone.
Thus on each of your buttons' presses, set a variable like...
_level0.frame_to_goto = "bill";
Or on another button...
_level0.frame_to_goto = "watson";
Or yet on another button...
_level0.frame_to_goto = "instructor";

Of course, 3 specific frames of the to be loaded movie, should be labeled with those 3 frame labels. Then on the first frame of that to be loaded movie, add the following...

Frame 1: (labeled "check")
if(_level0.frame_to_goto != ""){
this.gotoAndPlay(_level0.frame_to_goto);
} else {
// Do something else...
}

Frame 2:
this.gotoAndPlay("check");



Regards,

cubalibre2.gif
 
Nice site, Bill.

Thank you thats just what the doctor ordered.

OldNewbie I am sure that your method works as well but Bill's is much simpler as I just have to add the frame I want to goto to the loadMovie action.
 
Basically the same thing... Mine is 2 shorter lines rather than one long one, and mine does work from authoring.
So does Bill's by the way, if tested locally through an html!

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top