03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

} else {<br />

trace("finished loading. killing interval.");<br />

trace("-------------");<br />

for (i in target_mc) {<br />

trace(i+": "+target_mc[i]);<br />

}<br />

trace("-------------");<br />

clearInterval(param_interval);<br />

}<br />

}<br />

var param_interval = setInterval(checkParamsLoaded, 100);<br />

The params.txt file includes the following text:<br />

var1="hello"&var2="goodbye"&done="done"<br />

See also<br />

loadMovie (MovieClip.loadMovie method), loadVariablesNum function,<br />

unloadMovie (MovieClip.unloadMovie method)<br />

localToGlobal (MovieClip.localToGlobal method)<br />

public localToGlobal(pt:Object) : Void<br />

Converts the pt object from the movie clip's (local) coordinates to the Stage (global)<br />

coordinates.<br />

The MovieClip.localToGlobal() method allows you to convert any given x <strong>and</strong> y<br />

coordinates from values that are relative to the top-left corner of a specific movie clip to values<br />

that are relative to the top-left corner of the Stage.<br />

You must first create a generic object that has two properties, x <strong>and</strong> y. These x <strong>and</strong> y values<br />

(<strong>and</strong> they must be called x <strong>and</strong> y) are called the local coordinates because they relate to the<br />

top-left corner of the movie clip. The x property represents the horizontal offset from the topleft<br />

corner of the movie clip. In other words, it represents how far to the right the point lies.<br />

For example, if x = 50, the point lies 50 pixels to the right of the top-left corner. The y<br />

property represents the vertical offset from the top-left corner of the movie clip. In other<br />

words, it represents how far down the point lies. For example, if y = 20, the point lies 20 pixels<br />

below the top-left corner. The following code creates a generic object with these coordinates.<br />

var myPoint:Object = new Object();<br />

myPoint.x = 50;<br />

myPoint.y = 20;<br />

Alternatively, you can create the object <strong>and</strong> assign the values at the same time with a literal<br />

Object value.<br />

var myPoint:Object = {x:50, y:20};<br />

444 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!