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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Methods inherited from class Object<br />

addProperty (Object.addProperty method), hasOwnProperty<br />

(Object.hasOwnProperty method), isPropertyEnumerable<br />

(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf<br />

method), registerClass (Object.registerClass method), toString<br />

(Object.toString method), unwatch (Object.unwatch method), valueOf<br />

(Object.valueOf method), watch (Object.watch method)<br />

addListener (MovieClipLoader.addListener method)<br />

public addListener(listener:Object) : Boolean<br />

Registers an object to receive notification when a MovieClipLoader event h<strong>and</strong>ler is invoked.<br />

Parameters<br />

listener:Object - An object that listens for a callback notification from the<br />

MovieClipLoader event h<strong>and</strong>lers.<br />

Returns<br />

Boolean - A Boolean value. The return value is true if the listener was established<br />

successfully; otherwise the return value is false.<br />

Example<br />

The following example loads an image into a movie clip called image_mc. The movie clip<br />

instance is rotated <strong>and</strong> centered on the Stage, <strong>and</strong> both the Stage <strong>and</strong> movie clip have a stroke<br />

drawn around their perimeters.<br />

this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());<br />

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

mclListener.onLoadInit = function(target_mc:MovieClip) {<br />

target_mc._x = Stage.width/2-target_mc._width/2;<br />

target_mc._y = Stage.height/2-target_mc._width/2;<br />

var w:Number = target_mc._width;<br />

var h:Number = target_mc._height;<br />

target_mc.lineStyle(4, 0x000000);<br />

target_mc.moveTo(0, 0);<br />

target_mc.lineTo(w, 0);<br />

target_mc.lineTo(w, h);<br />

target_mc.lineTo(0, h);<br />

target_mc.lineTo(0, 0);<br />

target_mc._rotation = 3;<br />

};<br />

var image_mcl:MovieClipLoader = new MovieClipLoader();<br />

image_mcl.addListener(mclListener);<br />

MovieClipLoader 483

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

Saved successfully!

Ooh no, something went wrong!