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.

Sends the playhead to the next frame <strong>and</strong> stops it.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Example<br />

The following example uses _framesloaded <strong>and</strong> nextFrame()to load content into a SWF<br />

file. Do not add any code to Frame 1, but add the following ActionScript to Frame 2 of the<br />

Timeline:<br />

if (this._framesloaded >= 3) {<br />

this.nextFrame();<br />

} else {<br />

this.gotoAndPlay(1);<br />

}<br />

Then, add the following code (<strong>and</strong> the content you want to load) on Frame 3:<br />

stop();<br />

See also<br />

nextFrame function, prevFrame function, prevFrame (MovieClip.prevFrame<br />

method)<br />

onData (MovieClip.onData h<strong>and</strong>ler)<br />

onData = function() {}<br />

Invoked when a movie clip receives data from a MovieClip.loadVariables() or<br />

MovieClip.loadMovie() call. You must define a function that executes when the event h<strong>and</strong>ler<br />

is invoked. You can define the function on the Timeline or in a class file that extends the<br />

MovieClip class or is linked to a symbol in the library.<br />

This h<strong>and</strong>ler can be used only with movie clips for which you have a symbol in the library<br />

that is associated with a class. If you want an event h<strong>and</strong>ler to be invoked when a specific<br />

movie clip receives data, you must use onClipEvent() instead of this h<strong>and</strong>ler. The latter<br />

h<strong>and</strong>ler is invoked when any movie clip receives data.<br />

Example<br />

The following example illustrates the correct use of MovieClip.onData() <strong>and</strong><br />

onClipEvent(data).<br />

The symbol_mc is a movie clip symbol in the library. It is linked to the MovieClip class. The<br />

first function below is triggered for each instance of symbol_mc when it receives data.<br />

450 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!