::: Tutorials > Flash

Importing dynamic text content.
Load your content without having to change anything inside the flash file.
Tutorial by Ka Ming
Tuesday March 31, 2003
Download the source files from this tutorial: Download
(3kb)
|
In this simple tutorial, we will introduce dynamic contents.
This is quite an useful feature especially for web sites
that requires a lot of updates, like a news section of an
Flash web site where there will be constants of updates.
The main concept is direct Flash to load the contents outside of your Flash file into
the movie.
|
|
|
|
|
|
|
|
|
|
| 1 |
|
|
|
|
 |
|
First we will need a text file to import
from. Create a text file with your content inside, and
save it as text.txt. Be sure to save it to the same directory
as your Flash file.
NOTE: Be sure to start your text file with
this line:
textField =
|
|
|
|
|
|
|
|
|
|
| 2 |
|
|
|
|
 |
|
Open Flash and create a new
movie. Select the Text Tool and Create a text box. Right
click on
the text
box
and select properties. Select the tab dynamic on
the text option menu. And name the text box with the instance
of textbox. Then
find the form that said variable: or var:, and type in
textField.
|
|
|
|
|
|
|
|
|
|
| 3 |
|
|
|
|
 |
|
Finally, right click on the first frame and
select actions, this will bring up the action script window.
Copy the following script and paste it in the blank space
of the action script window.
loadVariables ("text.txt", "textbox");
}
|
|
|
|
|
|