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.

The dynamic_mc is a movie clip that is being loaded with MovieClip.loadMovie(). The code<br />

using dynamic_mc below attempts to call a function when the movie clip is loaded, but it<br />

doesn't work. The loaded SWF file must be a symbol in the library associated with the<br />

MovieClip class.<br />

The last function uses onClipEvent(data). The onClipEvent() event h<strong>and</strong>ler is invoked for<br />

any movie clip that receives data, whether the movie clip is in the library or not. Therefore,<br />

the last function in this example is invoked when symbol_mc is instantiated <strong>and</strong> also when<br />

replacement.swf is loaded.<br />

// The following function is triggered for each instance of symbol_mc<br />

// when it receives data.<br />

symbol_mc.onData = function() {<br />

trace("The movie clip has received data");<br />

}<br />

// This code attempts to call a function when the clip is loaded,<br />

// but it will not work, because the loaded SWF is not a symbol<br />

// in the library associated with the MovieClip class.<br />

function output()<br />

{<br />

trace("Will never be called.");<br />

}<br />

dynamic_mc.onData = output;<br />

dynamic_mc.loadMovie("replacement.swf");<br />

// The following function is invoked for any movie clip that<br />

// receives data, whether it is in the library or not.<br />

onClipEvent( data ) {<br />

trace("The movie clip has received data");<br />

}<br />

See also<br />

onClipEvent h<strong>and</strong>ler<br />

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

onDragOut = function() {}<br />

Invoked when the mouse button is pressed <strong>and</strong> the pointer rolls outside the object. You must<br />

define a function that executes when the event h<strong>and</strong>ler is invoked. You can define the<br />

function on the Timeline or in a class file that extends the MovieClip class or is linked to a<br />

symbol in the library.<br />

Note: This event h<strong>and</strong>ler is supported in Flash Lite only if System.capabilities.hasMouse<br />

is true or System.capabilities.hasStylus is true.<br />

MovieClip 451

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

Saved successfully!

Ooh no, something went wrong!