MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 518

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

MovieClip.onData
Availability
Flash Player 6.
Usage
my_mc.onData = function() {
// your statements here
}
Parameters
None.
Returns
Nothing.
Description
Event handler; invoked when a movie clip receives data from a
call. You must define a function that executes when the event handler is invoked.
loadMovie()
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
invoked when any movie clip receives data.
Example
The following example illustrates the correct use of
onClipEvent(data)
// symbol_mc is a movie clip symbol in the library.
// It is linked to the MovieClip class.
// The following function is triggered for each instance of symbol_mc
//
when it receives data.
symbol_mc.onData = function() {
trace("The movie clip has received data");
}
// dynamic_mc is a movie clip that is being loaded with MovieClip.loadMovie().
//
This code attempts to call a function when the clip is loaded,
//
but it will not work, because the loaded SWF is not a symbol
//
in the library associated with the MovieClip class.
function output()
{
trace("Will never be called.");
}
dynamic_mc.onData = output;
dynamic_mc.loadMovie("replacement.swf");
// The following function is invoked for any movie clip that
// receives data, whether it is in the library or not.
// Therefore, this function is invoked when symbol_mc is instantiated
//
and also when replacement.swf is loaded.
OnClipEvent( data ) {
trace("The movie clip has received data");
}
518
Chapter 12: ActionScript Dictionary
onClipEvent(data)
.
loadVariables()
instead of this handler. The latter handler is
MovieClip.onData()
or
and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents