all groups > flash actionscript > september 2007 >
You're in the

flash actionscript

group:

Attaching Movies


Attaching Movies capitalino
9/7/2007 8:28:05 PM
flash actionscript: Hello,

I?m attaching movies (mcButton) to a ?movie container? (mcMovieContainer). The
attached movie has a Dynamic Text field to which I want to change the text, I?m
using the code below but it is not working. I can attach the movies but I can?t
change the text. How can I do that?

btnAdd.onRelease = function() {

mcMovieContainer.attachMovie("mcButton", "mcButton"+i,
mcMovieContainer.getNextHighestDepth(), {_y:50*i+5, _x:5});

mcMovieContainer.mcButton[ i ].txtCaption.text = "Caption Text Here"

i++;

};

Thank you in advanced,

Re: Attaching Movies clbeech
9/7/2007 8:42:26 PM
a couple of approched here.

1) you could assign the text string to a variable within the attached mcButton
clip and pass the value to it in the attaching Object parameters:

var txtValue = 'Caption Text Here';
... {_y:50*i+5, _x:5, txt:txtValue});

2) you could track the depth with 'i' and call to the depth to assign the text
value:

mcMovieContainer.getInstanceAtDepth(i).txtCaption.text = "";
Re: Attaching Movies capitalino
9/7/2007 8:47:06 PM
It works!

mcMovieContainer.getInstanceAtDepth(i).txtCaption.text = "";


Thank you very much,
Re: Attaching Movies clbeech
9/7/2007 8:47:56 PM
AddThis Social Bookmark Button