Addressing an MC within another MC?

Hi Guys,

I have an MC (instance = mc1) that contains another MC (instance = mc2). is this the correct syntax to reference the internal MC ((instance = mc2):-

setProperty ("_root.mc1.mc2", _xscale, 0);

cheerz in advance guys.

It should work!:beard:

O.k - I got problems, I wan’t to put a preloader into an MC for re-useability. in the root movie it worked straight away. In the MC I adapted it and now it doesn’t wanna know, the pre loader has a blank MC inside it with the main AS inside, check it out:


onClipEvent (load) {
total = int(_root.getBytesTotal());
}
onClipEvent (enterFrame) {
micolor = new Color(_root.preload.progresive);
loaded = int(_root.getBytesLoaded());
percent = int(loaded/total*100);
if (percent>25) {
_root.preload.load = “Please Wait”;
micolor.setRGB( 0xFF9933 );
}
if (percent>50) {
_root.preload.load = “Loading…”;
micolor.setRGB( 0xFF6633 );
}
if (percent>75) {
_root.preload.load = “Loading”;
micolor.setRGB( 0xFF3333 );
}
if (percent==99) {
micolor.setRGB( 0xFF0000 );
}
_root.preload.percent = percent + " %";
setProperty ("_root.preload.progresive", _xscale, percent);
if (percent >= 100) {
tellTarget ("_root") {
play ();
}
}
}


The MC has an instance of ‘preload’ and a couple of threads above you can see the set property call in another layer.

Any ideas guys?

correct this line at let me know what happens!
percent = int(loaded/total*100);
it should be percent = int((loaded/total)*100);
It has to divide loaded by total and then multiply the number by 100 but right now it multiplies total by 100 and then divides loaded with it!:cool:

Cheerz syko,

That could also be correct, but I know this code functions fine when it was placed in the main movie.

My real problem is addressing the functions from within the MC as apose to the main movie. The main flow of the code should be correct.

e.g. instead of: micolor = new Color(_root.progresive);
I now use this: micolor = new Color(_root.preload.progresive);

It’s obviously addressed wrong somewhere in the code?

AHHHHHHGGGHHHHH!!

should work!
I have no idea why it’s not working!
Check it for typos in instance names or sth!

Syko - cheerz for your help mate.

You were right. The code was working but it was a STOP command outside of the MC that actually stoped the movie working. I nearly pulled my hair out.

1 last word of advive?

Do you reckon that a maximum of 50k per flash movie loaded into my site is a good file size, not sure if 50k is thought of as a high file size or not?

cheerz in advance.

well that depends! Is you r site only flash? What exactly is the 50k? intro? any section of the homepage? … depends :expressionless:

Well my site is 100% flash the intro is about 55K, the main menu part is again 50K and all the sub movies loaded in are nothing more than 30k each…

what d’ya reckon?