This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.
Seems like everything recently has to do with dynamically loaded this and dynamically loaded that. Of course, this writer will ride this wave for all its worth. After all, isn't that what Pop Culture Programming (PCP) is all about.
This tutorial will briefly explain how to load data from an external file. More importantly, you will learn how to display the data in your Flash animation. In the following animation, the data for name, e-mail, and location comes from an externally loaded text file.
You will create something similar to the following animation in this tutorial.
[ the data is externally loaded ]
Creating the Animation:

[ give the
dynamic text the instance name 'name' ]
name=Kirupa Chinnathambi&[email protected]&location=Earth
loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
name.text = this.name;
email.text = this.email;
location.text = this.location;
};
[ copy and paste the above lines of code ]
While you may have gotten the animation to work and display the text as intended, I am sure you would appreciate an explanation as to why the animation worked the way it did. Let's start with the code:
loadText = new loadVars();
This line creates a new object called loadText. Making
something an object grants you access to functions such as
load that you would otherwise have to define separately.loadText.load("data.txt");loadText.onLoad = function() {name.text = this.name;email.text = this.email;location.text = this.location;The text file is fairly straightforward. I
simply set
name=Kirupa Chinnathambi,
[email protected]
and
location=Earth. Note that I did
not use spaces between the variable, the equal sign, and the
value following it. Unlike other programming languages, I
did not have to enter quotation marks around the text values
I set the variables equal to. Finally, note that each
variable and its value is separated from the other variables
and values by the use of the wonderful ampersand ( & ).
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

:: Copyright KIRUPA 2026 //--