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

Controlling a Movie element in the Root level with a higher level?? 1

Status
Not open for further replies.

californiamusic

Technical User
Feb 3, 2002
6
US
Here's the URL, to see what I need to do. ( )

The main movie has a movie playing in it that is the sound (see headphones in left bottom corner ). I need level 3 (music) when loaded to send a command to the "sound" movie playing in the main movie, to go to and stop on frame 6.

Any help would be very appreciated!! Thanks!


californiatunes@aol.com
 
A bit of confusion in your question!

Which movie exactly do you want to send and stop on frame 6?

From a loaded movie on level 3, if you want the main movie to go to frame 6, you would use:

_level0.gotoAndStop(6);

Even better would be to label frame 6 of the main movie with an unique label (such as test_stop) and use:

_level0.gotoAndStop("test_stop");

If your targeting frame 6 of a movie clip in the main movie, you would have to add that movie clip's instance (such as mymovieclip) name in the path as:

_level0.mymovieclip.gotoAndStop(6);

Or, if you had labeled frame 6 of mymovieclip with test_stop2, then:

_level0.mymovieclip.gotoAndStop("test_stop2");

Regards,
new.gif
 

Thanks for the reply. To clarify, I have a symbol (movie playing within the main level - headphones) in the main level that I want to go to and stop at frame 6, when level 3 is loaded. I though this might work:

_level0.mymovieclip.gotoAndStop(6);

but it had no effect on the symbol playing in the main level.



 
So, if I get this right... If I load "The Only One", for example, you want the headphones movie clip to be "disabled"?

Well, if you use _level0.headphoneinstance'sname.gotoAndStop(6); it should work! Although I would label frame 6 with test_stop (or whatever!) and use:

_level0.headphoneinstance'sname.gotoAndStop(6);

Make sure the headphone instance's name you're referring to, appears in the name box in the Instance panel, not just as the movie clip's name!

Guess this script should be added in your speaker buttons when loading a tune, and send the headphones back to frame 1, when hitting the close song button with something like:

_level0.headphoneinstance'sname.gotoAndPlay(1);

Did I get it this time?

Regards,
new.gif
 
That's exactly what Im trying to accomplish. I just tried that, but it didn't work. I must have something mis-labeled somewhere. If you get bored, feel free to take a look. Maybe you can spot my mistake.
On music.fla, I am entering that command only on button 1, frame 125..
Thanks again!





: )
 
Ok! As I thought, you haven't named the sound instance, and this is furthermore complicated by the tweens you have on that movie clip.
In the newest.fla, select the first keyframe of your sound layer, and in the Instance panel, add the name sound in the name box, under the behavior box. It doesn't suffice that the movie clip be named sound, each instance you'll be referring to, needs to be named.
Once it's done on the first keyframe, because of your tweens, you'll have to repeat this in the other 2 keyframes you have on that layer. Repeat the instance's naming process above on keyframes 20 & 194.

Now in frame 124 of your music.fla, change your script:

on (release) {
stopAllSounds ();
}
on (release) {
loadMovieNum ("onlyone.swf", 8);
}
on (release) {
unloadMovieNum (6);
unloadMovieNum (7);
}

To the following:

on (release) {
_level0.sound.gotoAndStop(6);
stopAllSounds ();
unloadMovieNum (6);
unloadMovieNum (7);
loadMovieNum ("onlyone.swf", 8);
}

Guess you'll have to change your scripts on buttons 2 & 3 in a similar manner.

A few extra notes on all this:

If you allways loaded a soundtrack movie on the same level, level 8 for instance, there would be no need to unload the previous movies loaded, since loading the new one would simply replace the old one... This would simplify your script!
Can't tell how you've set up each individual tune movie itself (like stop actions & stuff!), but it might be of no use to unload other levels anyways... When unloaded, each tune does have to reload each time the user presses that selection, rather than just play (since it's in the user's cache), if he's made that selection before.

One final problem, you may not have realized, is that, while listening to The Only One, for example, if I press the headphone button, the main movie's sound track will start playing again over the other tune, eventhough your icon seems disabled.
You may want to set a variable, when an another sound is playing on another level, to really disable the main soundtrack.

We can get into a way of doing that later, if you're interested!

PS: Nice work!

Regards,
new.gif
 


Works perfectly.. thanks SO much! I can stop banging my head on my comp. desk now! : )
I don't want to overstate the obvious, but your the man!!

I see the problem your talking about with the main sound playing over the song onClick. Should I start a new topic on that one?

Glenn
californiatunes@aol.com
 
Please do! Just e-mailed you at the above address!
Is that right?

Regards,
new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top