# Cannot get my AS to talk to a child MC? Basic code stuff

**URL:** <https://forum.kirupa.com/t/cannot-get-my-as-to-talk-to-a-child-mc-basic-code-stuff/189661>\
**Category:** Uncategorized\
**Created:** [June 5, 2006, 3:56am UTC](https://forum.kirupa.com/t/cannot-get-my-as-to-talk-to-a-child-mc-basic-code-stuff/189661 "2006-06-05T03:56:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![messlah](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@messlah](https://forum.kirupa.com/u/messlah)\
**Post date:** [June 5, 2006, 3:56am UTC](https://forum.kirupa.com/t/cannot-get-my-as-to-talk-to-a-child-mc-basic-code-stuff/189661/1 "2006-06-05T03:56:41Z")

</div>

Hey all,

I am trying to get my preloader setup so that all of the MC’s that make it up (loadBar, loadBarHousing) fit nice in one MC.

My problem is that I dont understand why I can not get my loadBar MC & loadBarHousing MCs to work when they are put into this parenting MC.

This is my original AS that works when all of the MC are together in the main \_root. timeline of my fla.

// Specify how many frames to load before playing.  
var loadAmount = \_totalframes;

// If the required number of frames have finished loading…  
if (\_framesloaded == loadAmount) {  
// …start the movie  
gotoAndPlay(“beginMovie”);  
} else {  
// …otherwise, display the load status  
// then go back and check load progress again.

// First, determine the loaded and total kilobytes.  
loaded = Math.round(getBytesLoaded() / 1024);  
total = Math.round(getBytesTotal() / 1024);  
percent = Math.round((loaded/total) \* 100);

// Display the loaded kb, total kb, and percentage of  
// kb loaded in text fields.  
bytesLoadedOutput = loaded;  
bytesTotalOutput = total;  
percentOutput = percent + “%”;

// Set the width of the loadBar to a percentage of  
// the loadBarHousing.  
loadBar.\_width = loadBarHousing.\_width \* (percent / 100);

// Now go back and check load progress.  
gotoAndPlay(“loading”);  
}

Now I thought all I would have to do is alter the code to the setup below once I had put those MCs into the parenting the\_loader MC and gave it the instance name the\_loader.

\_root.the\_loader.loadBar.\_width = \_root.the\_loader.loadBarHousing.\_width \* (percent / 100);

But when I do this those MC do not operate anymore on stage.

If someone could show me why, would be much appreciated.
