Ok, guys. In this flash tutorial I will explain how to load variables from external text file into dynamic text field. Its a pretty easy task and we will complete it in 5 steps.Please note that you will need this tutrial in the next lesson where we will be creating flash contact form.
Ok, lets go and first create 2 layers called "layout" and "actions". Hope it's clear that one of them will be used for action script coding and another one for graphics.
 

Let's select the "layout" layer and create text field. As you can see on the properties tab the text field should be set to "dynamic", you can also play around with the font type and size. Under the "Dynamic" dialog we will assign internal name for this element which is "TextBox". If you are developing huge project I would recommend you to name your flash elements according to their functionality.


Good, now it's time to jump to "actions" layer and add some action script coding. As you see I try to use as many comments as I can, it will make further editing and upgrade of flasj somponent much easier both to you and your customers. Sofist thing we do is declare variables in the 1st line. Then we tell what will be the source txt file for our variables. And finally we load the variable from text file and handle the errors if any. Also the line TextBox.HTML = true aoows to support HTML formatting of the text. Ok, lets consider it done.


Now you should press CTRL-Enter button to compile flash movie into swf format and see if everything work. The last thing we've left to do is add a scroll bar. Of course we can create our own scroll bar, but let's keep things simple at the moment and use standard flash UI component. Simply open "Components Inspector" drag and drop the scroll bar on the dynamic text square. If you did it right you will have the same results as on the image below.



Now lets compile the movie and see the results. Looks good? I know it is :-) Ok, here are the flash source files, enjoy and get back to us later to see how to create flash contact form.