dcsimg
First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Zoubin Zarin | Website: http://www.zarinmedia.com/

Text File

A practical application for this dynamic graph is to import data from a text file that is updated regularly. (you can have the server side programmers deal with writing the programs to update the actual text file on the fly, but that type of development is another tutorial in itself :)

We can make use of flash 4's loadmovie action script, and select the load variables into location option. What this function does is what it suggests - it takes in data from a text file and makes it accessable in flash.

But for this feature you must specify where you'd like to load the variables. (you have a choice to load them into a movie level, or a target pathname). In this case we'll load them into _level0 because we'd like them to be easily visible and accessable for our dynamic graph program (hmm! I just called an .fla a program!)

And of course you would not need to populate your graph with random numbers. So omit the randomly generated variable script in frame 1 of the "script" layer. You also won't need to loop back to frame one either so just delete the "refresh" layer completely. The stop action in Frame 3 needs to be replaced with a go to and play (2) action. This will perform a check to ensure the data is loaded.

Note: the data in the text file must be in a standard MIME format application/x-www-urlformencoded (in plain english.. this is a common format used to communicate with cgi.. its very simple..) and must also come with its complete URL (eg http://www.flashkit.com/data/data.txt).

» Level Advanced

Added: 2000-04-13
Rating: 7.98 Votes: 327
» Author
Zoubin Zarin is the core of zarinmedia, a newmedia company specializing in advanced flash design / development / and programming. Zoubin is also the creator of www.flashskills.com, a directory of freelance flash developersonline, listed according to skill level, location, availability for work.
» Download
Download the files used in this tutorial.
» Forums
tuteicon
More help? Search our boards for quick answers!
fk_wncornlft
fk_wnmid
fk_wncornrght
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.