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!

control movie clip in container from button inside other movie clip 1

Status
Not open for further replies.

newflasher

Technical User
Jul 31, 2003
2
US
There are three movie clips involved in this question.

1. A main movie clip that has a target empty movie clip where an external swf loads.

2. A menu movie clip that is built from button symbols and has its own timeline.

3. The external movie.

When a user clicks on the menu, the external swf loads into the empty movie clip target. This part works fine. Here's the code:
on (release) {
loadMovie ("Lesson1.swf", "_root.container");
}

I want to use one external swf for all lesson, versus 20 external swfs. The problem I'm having is controling at what frame the external swf loads. I've tried adding --gotoAndStop (15) -- for example. I've also tried adding, gotoAndStop "_root.container" (15), but that doesn't work either. The gotoAndStop action ends up controlling the menu movie clip timeline instead of the movie loaded into the container. I figure this is because the menu mc has "embedded" buttons and it's own timeline.

Any help you can offer will be much appreciated.

Thanks
Sheila

 
If I understand you correctly, once the external movie is loaded, you can control it with...

_root.container.gotoAndStop(15);

Or...

_root.container.gotoAndStop("frame_label");




Regards,

cubalibre2.gif

Bacon, eggs and sunshine are still good for me!
 
assumes all have frame labels can be changed to nums

on (release) {
loadMovie("lesson1.swf?frame=lesson1",_root.container);
}

next button

on (release) {
loadMovie("lesson1.swf?frame=lesson2",_root.container);
}



first frame in lesson1.swf

if(frame==undefined){
gotoAndPlay(2)
}else{
gotoandPlay(frame)
}

frame 2

gotoAndPlay(1);

and in the frame actions for all named frames

frame = undefined;



_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Hi I was wondering if you could elaborate on the control movieclip. I am afraid you lost me with the frame 2, lesson1, instructions. As well, where do I put the frame=undefined, does it conflict with other scripts? I have heard that one should not numericaly name framescripts, is this acurate?
Thankyou for your patience.
 
you should make make frame labels meaningful strings.

in this context frame is just a variable holding the value of the frame label to jump to. it wont conflict with any other scripts unless they too have access to this variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top