![MACROMEDIA Flash Lite 2 Скачать руководство пользователя страница 494](http://html1.mh-extra.com/html/macromedia/flash-lite-2/flash-lite-2_reference_687553494.webp)
494
ActionScript classes
Example
The following example uses
_framesloaded
and
nextFrame()
to load content into a SWF
file. Do not add any code to Frame 1, but add the following ActionScript to Frame 2 of the
Timeline:
if (this._framesloaded >= 3) {
this.nextFrame();
} else {
this.gotoAndPlay(1);
}
Then, add the following code (and the content you want to load) on Frame 3:
stop();
See also
nextFrame function
,
prevFrame function
,
prevFrame (MovieClip.prevFrame
method)
onData (MovieClip.onData handler)
onData = function() {}
Invoked when a movie clip receives data from a MovieClip.loadVariables() or
MovieClip.loadMovie() call. You must define a function that executes when the event handler
is invoked. You can define the function on the Timeline or in a class file that extends the
MovieClip class or is linked to a symbol in the library.
This handler can be used only with movie clips for which you have a symbol in the library
that is associated with a class. If you want an event handler to be invoked when a specific
movie clip receives data, you must use onClipEvent() instead of this handler. The latter
handler is invoked when any movie clip receives data.
Availability:
ActionScript 1.0; Flash Lite 2.0
Example
The following example illustrates the correct use of
MovieClip.onData()
and
onClipEvent(data)
.
The symbol_mc is a movie clip symbol in the library. It is linked to the MovieClip class. The
first function below is triggered for each instance of symbol_mc when it receives data.
The dynamic_mc is a movie clip that is being loaded with MovieClip.loadMovie(). The code
using dynamic_mc below attempts to call a function when the movie clip is loaded, but it
doesn't work. The loaded SWF file must be a symbol in the library associated with the
MovieClip class.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...