Before Read my Article,

PLEASE HELP ME TO VOTE MY PICTURE AT

PONDS SITE (CLICK HERE)

YOU ONLY NEED TO PUT YOUR NICK NAME AND YOUR EMAIL

You WILL NOT GET ANY EMAIL FROM THEM. Just put Ur name and it will done.

Thank you

************

This time I will try to give how to load text from file in Flash tutorial. In next post I will explain how to load HTML type text.

I’m still using Macromedia Flash 8.

Fla and Txt File for download :

Download Example Load Text from file at Flash by Shireishou

Click picture to enlarge

1. Use Text Tool (A) and make huge box like this. And set the property like :
a. Instance name : ins
b. Type text : Dynamic and set it at Multiline
c. Var : name

(see picture for brief example)

2. Create notepad file. Name it with fanfic.txt. Write at first line name=BLABLA. Make sure name=BLA is WITHOUT space. You just need to press enter if you want to make enter. Double enter will caused 2 space.



3. Back to flash and create new layer (press button in red square)

4. In frame 1, press F9(action script) and type

stop();
loadVarsText = new LoadVars();
loadVarsText.load("fanfic.txt");
loadVarsText.onLoad = function (success) {
if(success){
ins.text = this.name;
}
textBox.text = this.name;}

I will explain it latter

5. Windows->Components (ctrl+F7)

6. Choose UIScrollBar

7. Drag it into the right side on the box for put the scroll bar

8. Done

Action Script explanation

stop();

This function for stopping flash moving to next frame

loadVarsText = new LoadVars();

to declare new loadVars and named as loadVarsText

loadVarsText.load(“fanfic.txt”);

Load file fanfic.txt

loadVarsText.onLoad = function (success) {

if(success){
ins.text = this.name;
}
textBox.text = this.name;

}

If the file able to loaded, then what we wrote after word “name” will put at dynamic text ins.

Hope it clear enough. If you have any question pls feel free to ask.