1. Computing & Technology

Discuss in my forum

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

By , About.com Guide

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.

©2012 About.com. All rights reserved.

A part of The New York Times Company.