0

I created a TLF Text with the Flash IDE in the main document.
I've assigned it an instance name with the IDE

When I try to access the text with Actionscript I cannot access the text field.
Of course if I transform in the IDE the text in classic dynamic text it works as expected

I feel very stupid and I suspect it has an obvious solution but I cannot find any info about the subject

// instance name is "myText"

trace(this.myText);
>> null

trace(this.getChildAt(0));    
>> [object Movie Clip]

trace(this.getChildbyName("myText"));
>> null
yuri
  • 575
  • 1
  • 14
  • 33

2 Answers2

1

The following code might be of help.

var markup:XML = 
    <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>
        some text...
    </TextFlow>;
var flow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
var sprite:Sprite = new Sprite();
flow.fontFamily = 'font name...'
flow.flowComposer.addController(new ContainerController(sprite, width, height));
flow.flowComposer.updateAllControllers();

parent object.addChild(sprite);
sprite.x = some
sprite.y = where
M. Kim
  • 26
  • 3
  • Thanks! You open my mind. I finally found the Actionscript manual page [for Displaying Content with Flow Composer](http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WSc3ff6d0ea7785946579a18b01205e1c5646-7ff2.html) – yuri Feb 18 '11 at 08:13
0

I think you work on the flash class.

I cannot access the TLF Text instance on flash class code but it works on ActionScript in frame. Edit the code in ACTIONS - FRAME.

M. Kim
  • 26
  • 3
  • Cannot attach script to frame because I was need to access the text from a custom class. – yuri Dec 03 '10 at 11:41