PDA

View Full Version : the path to a clip with an attached Movie Clip


AudryLucy
12-11-2003, 08:40 PM
Hi,
I feel pretty dumb asking this question, but I'm a little confused about how to reference a movie clip that is inside of an attached movie clip. Should the path reference the attached clip's linkage name or it's new name? The attached clip is on the root level...should I start the script with _root or _level0?

Thanks

bluegel
12-12-2003, 05:58 AM
you could use levels, or I think you can call it from its instance name...

mov1.mov2. etc

Lighty
12-12-2003, 07:48 AM
If "mov1" is an instance name of a movie clip inside the movie clip "my movie" the following will reference it:



//Attach movie to the root timeline
attachMovie("my movie", "myMovie", 10);

//All three lines reference the same thing using the new name
_root.myMovie.mov1._x = 100;
_level0.myMovie.mov1._x = 100;
myMovie.mov1._x = 100;



If you attach the movie clip to a movie clip already on the stage then you have to add this name to the path



//Attach movie to the root timeline, newMovie already on stage
newMovie.attachMovie("my movie", "myMovie", 10);

//All three lines reference the same thing
_root.newMovie.myMovie.mov1._x = 100;
_level0.newMovie.myMovie.mov1._x = 100;
newMovie.myMovie.mov1._x = 100;



Hope that all makes sense

Lighty

AudryLucy
12-12-2003, 11:34 AM
I'm sorry if this message gets posted more than once...I'm experiencing some technical difficulties. Everytime I reply to a post, the thread doesn't update. Hopefully it will work this time.
Here's my reply to the last post:

If there is a movie clip inside the Attached Clip that I'm trying to control...what should the AS look like...
I'm trying to stop a movie clip inside of this attached clip...but this line of script that I came up with, does not do the trick:
<as>
_root.menu2.but2.pause_mc.pause_btn.onRelease = function() {
tellTarget ("_root.outcomes.outcomeVoice_mc") {
stop();
//"outcomes" is the new name of the attached clip
//this script stops the movie clip, for the out comes section, that plays the mc: outcomeVoice_mc

}
};
stop();
</as>

The movie clip is continuing to play...even though I am referencing the "new name" of the of the attached clip.

Any suggestions?

Lighty
12-12-2003, 11:45 AM
Try putting a trace function inside your onRelease function to see whether the function is being called at all - Your path to the button may be wrong.

Try using


_root.outcomes.outcomeVoice_mc.stop();


to stop the movie clip as well.

What is your code for attaching the movie clip?

AudryLucy
12-12-2003, 11:50 AM
Hi Lighty,

I tried to figure this out before I posted...but sometimes it just doesn't come to me until I try to fix it about a million times...I discovered the issue right after I posted. I'm sorry if you wasted any more time helping me find the answer. This is what I was overlooking:

I was using a "host movie clip" (much like when you use external swfs) to attach the movie clip within. I was failing to reference that host clip first, in the path. It should have looked like this:
__________________________________________________ ___________
_root.menu2.but2.pause_mc.pause_btn.onRelease = function() {
tellTarget ("_level0.hostClip_mc.outcomes.outcomeVoice_mc") {
stop();
//this script stops the movie clip, for the out comes section, that plays the voiceOvers.
}


};
//outcomesVoice is the name of the movie clip within the "outcomes_mc" where
//the sound clip is located.
//**the above function pauses the streaming sound clip that is located on the stage.
stop();
__________________________________________________ ___________

I decided to use levels because I'm attaching the clip in levels like this:

_levelo.attachMove("outcomes_mc", "outcomes",1);


Anyway, thanks for the help. I think I've got it straight now.

p.s.
I tried to highlight the AS in my last post with html tags...It didn't work. What did I do wrong?

Thanks again!