Hi All,
I’ve made a flash movie which will load four movie clips at runtime. Actually, the number of movie clips will depend upon number of “NODE” in XML file. Keeping XML file thing aside, I’ve tried hardcoded values; 4. Let me describe you the structure very well:
There is a main empty movie clip, instance name “mc_scroll” which will be only item on stage. In this movie clip, another movie clip whose identifier name is “blueMovie” will be loaded dynamically. Inside this “blueMovie” MC, there is a button instance name is “blueButton” and inside this button there is a “Dynamic Text” field instance name is “btn_text”.
Phewww… so long chain… inshort:
mc_scroll->blueMovie->blueButton->btn_text
Now, I can load 4 or any number of “blueMovie” inside “mc_scroll”. But I also want to set the button text for each button inside each MC!! I’m sure you guys are getting what I want to do. But its not working. Below is the code:
//INSIDE THE MAIN TIME LINE
for(i=0; i<4; i++)
{
txt="blue"+i;
mc_scroll.attachMovie("blueMovie", txt, mc_scroll.getNextHighestDepth(), {_y:50*i+5, _x:5});
mc_scroll.txt.blueButton.btn_text.text = txt;
}
//INSIDE THE "blueMovie" MC which has the button
blueButton.onRelease = function() {
trace(this._parent);
trace(this.btn_text);
}
if I click on the first button, it prints below"
_level0.mc_scroll.blue0
undefined
for second button and so on it prints
_level0.mc_scroll.blue1
undefined
Can anybody help me to understand as how to assign the text dynamically which is inside a button and this button inside a MC which is created dynamically inside a main MC!!!
I’ve attached the FLA also.
Regards,
Javed