views:

648

answers:

1

I've created an animated scene in Flash, with a bar chart. The bar is a MovieClip symbol containing a large rectangle and a TextField. I'd like to access the TextField using actionscript, but I can't seem to reference it.

Each bar in the scene has its own instance name, so that's easy to find.

But how do I modify the text in the textfield within the symbols?

I tried giving the textfield an instance name within the symbol, but that didn't help. Could someone help me figure this out?

A: 

Oh. Turns out I managed to do it in the end...

Symbol:

bar:MovieClip containing rectangle, TextField with instance name "barText".

on the stage there are two instances of bar -- called bar1, bar2.

to access the text in the text box:

import flash.text.TextField; 

bar1.barText.text = "hello"; 
bar2.barText.text = "foo";

Can I attach the .fla anywhere?

Attach the FLA?
Lior Cohen
I put the answer into an .fla file. I wanted to put it somewhere and link to it.
Didn't this answer already the question? Why need to attach the fla?
David