1. Home
  2. Computing & Technology
  3. Animation

Using Variables from an External Source with Flash's loadVariables()

By Adrien-Luc Sanders, About.com

6 of 9

Right-click on the movie clip and select Actions to open the Actions panel. Here we'll set up an onClipEvent to tell the ActionScript that every time the clip cycles through its single frame, it checks the text file and loads the variables inside:
onClipEvent(enterFrame){
loadVariables("variables.txt", this);
}

By using onClipEvent (enterFrame), that makes sure that the text dynamically updates as soon as the text file is updated.

Right now, though, loadVariables() doesn't really do anything, because we haven't told it what file to load.

Explore Animation
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Using Variables from an External Source with Flash's loadVariables()

©2009 About.com, a part of The New York Times Company.

All rights reserved.