03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

switch (Key.getCode()) {<br />

case Key.SPACE :<br />

horn_sound.start();<br />

break;<br />

case Key.LEFT :<br />

car_mc._x -= DISTANCE;<br />

break;<br />

case Key.UP :<br />

car_mc._y -= DISTANCE;<br />

break;<br />

case Key.RIGHT :<br />

car_mc._x += DISTANCE;<br />

break;<br />

case Key.DOWN :<br />

car_mc._y += DISTANCE;<br />

break;<br />

}<br />

};<br />

Key.addListener(keyListener_obj);<br />

LoadVars<br />

Object<br />

|<br />

+-LoadVars<br />

public dynamic class LoadVars<br />

extends Object<br />

You can use the LoadVars class to obtain verification of successful data loading <strong>and</strong> to monitor<br />

download progress. The LoadVars class is an alternative to the loadVariables() function for<br />

transferring variables between a Flash application <strong>and</strong> a server.<br />

The LoadVars class lets you send all the variables in an object to a specified URL <strong>and</strong> to load<br />

all the variables at a specified URL into an object. It also lets you send specific variables, rather<br />

than all variables, which can make your application more efficient. You can use the<br />

LoadVars.onLoad h<strong>and</strong>ler to ensure that your application runs when data is loaded, <strong>and</strong> not<br />

before.<br />

The LoadVars class works much like the XML class; it uses the load(), send(), <strong>and</strong><br />

sendAndLoad() methods to communicate with a server. The main difference between the<br />

LoadVars class <strong>and</strong> the XML class is that LoadVars transfers <strong>ActionScript</strong> name <strong>and</strong> value<br />

pairs, rather than an XML Document Object Model (DOM) tree stored in the XML object.<br />

The LoadVars class follows the same security restrictions as the XML class.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

702 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!