First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: Patrick Mineault

The first thing that we added is the loadVariables statement. This loads the variables from the text.txt file. Now, when Flash opens the text file, it sees daTextBox=blablabla, so it sets the internal variable daTextBox to «blablabla». Note that we use the "this" operator, which refers to the current clip, to show Flash that we want the variables loaded into containerMC, not in the main timeline or in some other clip.

This single line asks Flash to load the text file into the movie. When the text is on a server, Flash has to make a connection to it and retrieve the data. This takes time. Now, it's useful to know when the text has finished loading. You might want to do something when the text is loaded, like play a "tada" sound, for example.

Hence, we introduce yet another clip event, data. The data clip event is fired immediately after a text file is loaded with loadVariables. So when the data clip event is fired, we know the file is loaded into Flash.

It's not enough, however, to know that the text file is loaded. You see, when Flash loads a text file into a movie, it must parse the file, and parsing takes time. So even though our text file is loaded, Flash might only fill the textbox one or two frames later.

So what is done is, at first, the needInit variable is set to false. When the textfile is loaded, the data clip event is fired, and the variable needInit is set to true. In our enterFrame clip event, this fires an if condition. This if checks whether or not the textbox's maxscroll property has been updated. If it has been updated, it should be bigger than 1, and that means is text is both loaded and parsed.

Right now, there's only a comment in there that says "Text is loaded!". Later, when the scrollbar is added, we'll fire an event when we know the textfile is loaded and parsed to change the height of our scrolbar. Confused? Maybe a diagram will help:

That wasn't too hard now, was it? It's time for some hardcore ActionScript.

» Level Intermediate

Added: 2001-07-17
Rating: 8 Votes: 176
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.