PDA

View Full Version : controlling mc in swf


countryman
12-05-2001, 02:17 AM
This is a simple question but sometimes they can be the hardest to figure out (at least for me)

I have my main swf (level 0) then I have loaded a second swf into level 2. This swf files has buttons that need to control MC's in level 0. Can someone look at the code below and tell me what I am doing wrong.


on (release) {
tellTarget ("/reproducemc") {
gotoAndPlay (2);
}
}

tg
12-05-2001, 02:27 AM
should work, unless your instance name is spelled differently.

countryman
12-05-2001, 11:40 PM
Don't I have to indicate if it is in the main swf some how with root or parent?

countryman

tg
12-06-2001, 12:11 AM
on (release) {
tellTarget ("/reproducemc") {
gotoAndPlay (2);
}
}


the "/roproducemc" says you have an mc on _root ("/") with an instance name of reproducemc.

your code does the same as this...

_root.reproducemc.gotoAndPlay(2);

... you just get to type more the other way.

countryman
12-06-2001, 02:16 AM
Thanks. Will give it a shot

countryman

Billy T
12-06-2001, 02:58 AM
think you will need to say


on (release) {
tellTarget ("_level0.reproducemc") {
gotoAndPlay (2);
}
}

I think _root will just refer to the main timeline in your external movie

cheers

tg
12-06-2001, 04:32 AM
ya, i was just going off the provided code.
you can also try

_parent.reproducemc.gotoAndPlay(2);

(if the button is on the main timeline of the child swf).