Groups | Blog | Home
all groups > flash actionscript > september 2006 >

flash actionscript : Can't write to a TextArea in a dynamically place movie clips.


ecir
9/17/2006 3:44:30 PM
Hi there I was hoping someone could help me.

I have a movie clip in the library with a linkage name ?myPdpBlock?; this
movie clip has a TextArea and a CheckBox in it. My question is why is it when I
use the code below to put 5 instances on the stage (instBlock0,
instBlock1...etc) when I debug the movie I can see all of the 5 instances in
the debugger window but the TextArea and CheckBox don?t appear inside each
instance even though they have instance names. I want to dynamically place any
number of my myPdpBlock movie clips on the stage then feed text into the
TextArea from a database.

Cheers.

var NumberOfPDPs:Number = 5;

var i:Number = 0;
for (i=0; i<5; i++) {
_root.contentMain.attachMovie("myPdpBlock", "instBlock"+i, i, {_y:i*50});
if (["instBlock"+i]._width == 0) {
break;
}
}
kglad
9/17/2006 4:06:04 PM
ecir
9/17/2006 5:01:14 PM
Hi there - thanks for the quick response. Yes I do get something on the stage:
5 instances of the movie clip from the library one after another. The problem
now is that I can't access the TextArea (or checkbox) that is on each of the 5
instances. In the debugger I can see:

_level0.contentMain.instBlock0
_level0.contentMain.instBlock1
_level0.contentMain.instBlock2
_level0.contentMain.instBlock3
_level0.contentMain.instBlock4

?but each of the above instances can't be expanded to view the TextArea (which
has an instance name of 'dueBy').

So visually it is fine I just can?t gain access to all of the TextAreas.

Someone in another forum mentioned that it has something to do with levels but
I thought levels were used if you are bringing in external SWFs. And besides if
it does have something to do with levels I don't know how to amend the code to
make things work. Any help would be greatly appreciated.

Cheers.

kglad
9/17/2006 5:20:29 PM
what do you mean by "... can't access the textarea of checkbox"?

ecir
9/17/2006 5:43:58 PM
Sorry I'm not using the correct terminology.

Visually I can see the TextAreas and CheckBoxs on the stage but they don't
appear in the debugger.
So I'm left with 5 instances of a movie clip sitting on the stage (each with a
TextArea and CheckBox) but I have no way of dynamically entering text into the
TextAreas (or gathering info on whether or not a CheckBox has been checked).


AddThis Social Bookmark Button