0
votes

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
2

2 Answers

1
votes

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
0
votes

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.