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.

Example<br />

The following example creates a movie clip at runtime called box_mc. The Drawing API is<br />

used to draw a box in this instance, <strong>and</strong> when the mouse rolls over the box, horizontal <strong>and</strong><br />

vertical scaling is applied to the movie clip. When the mouse rolls off the instance, it returns<br />

to the previous scaling.<br />

this.createEmptyMovieClip("box_mc", 1);<br />

box_mc._x = 100;<br />

box_mc._y = 100;<br />

with (box_mc) {<br />

lineStyle(1, 0xCCCCCC);<br />

beginFill(0xEEEEEE);<br />

moveTo(0, 0);<br />

lineTo(80, 0);<br />

lineTo(80, 60);<br />

lineTo(0, 60);<br />

lineTo(0, 0);<br />

endFill();<br />

};<br />

box_mc.onRollOver = function() {<br />

this._x -= this._width/2;<br />

this._y -= this._height/2;<br />

this._xscale = 200;<br />

this._yscale = 200;<br />

};<br />

box_mc.onRollOut = function() {<br />

this._xscale = 100;<br />

this._yscale = 100;<br />

this._x += this._width/2;<br />

this._y += this._height/2;<br />

};<br />

See also<br />

_x (MovieClip._x property), _xscale (MovieClip._xscale property), _y<br />

(MovieClip._y property), _height (MovieClip._height property)<br />

MovieClipLoader<br />

Object<br />

|<br />

+-MovieClipLoader<br />

public class MovieClipLoader<br />

extends Object<br />

480 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!