# XML to dynamic textfield

**URL:** https://forum.kirupa.com/t/xml-to-dynamic-textfield/277377
**Category:** flash
**Created:** [December 11, 2008, 11:33am UTC](https://forum.kirupa.com/t/xml-to-dynamic-textfield/277377 "2008-12-11T11:33:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![le\_chief](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@le\_chief](https://forum.kirupa.com/u/le_chief)
#### Post date: [December 11, 2008, 11:33am UTC](https://forum.kirupa.com/t/xml-to-dynamic-textfield/277377/1 "2008-12-11T11:33:47Z")

</div>

Hi everyone,

I’m quite new with Flash and experiencing some problems with xml and as3.  
What I want is to load text from external xml-file to dynamic text field in Flash.

The very basic xml-file introduction.xml looks like this:

* * *

\<root\>  
\<bio\>  
lorem ipsum etc.  
\</bio\>  
\</root\>

My code goes like this:

* * *

[FONT=Helvetica][/FONT]  
[FONT=Helvetica][FONT=Verdana]this.stop();[/FONT][/FONT]  
[FONT=Helvetica][/FONT]  
[FONT=Helvetica][FONT=Verdana]var introduction:XML;[/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana]var xmlLoader:URLLoader = new URLLoader();[/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana]xmlLoader.addEventListener( Event.COMPLETE, xmlLoaderComplete );[/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana] [/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana]xmlLoader.load( new URLRequest( ‘introduction.xml’ ));[/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana] [/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana]function xmlLoaderComplete( evt:Event ):void {[/FONT][/FONT]  
[FONT=Verdana][FONT=Helvetica] introduction[/FONT][FONT=Helvetica] = XML( evt.target.data);[/FONT][/FONT]  
[FONT=Verdana][FONT=Helvetica] [/FONT][FONT=Helvetica]trace( introduction.bio );[/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana] [/FONT][/FONT]  
[FONT=Helvetica][FONT=Verdana]}[/FONT][/FONT]

* * *

Tracing is ok, no problem, but how should I load this xml-file to dynamic text field? I have dynamic textfield called content but I can’t find the right way to get that xml to this content.

I know it’s quite basic thing for most of you, but as I said I’m quite new with Flash… If someone is willing to help me it would be highly appreciated!
