EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Rotation (Movieclip._Rotation Property)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
510 ActionScript classes
Example
Each time you click a button in the following example, you attach a movie clip instance to the
Stage in a random position. When you click a movie clip instance, you remove that instance
from the SWF file.
function randRange(min:Number, max:Number):Number {
var randNum:Number = Math.round(Math.random()*(max-min))+min;
return randNum;
}
var bugNum:Number = 0;
addBug_btn.onRelease = addBug;
function addBug() {
var thisBug:MovieClip = this._parent.attachMovie("bug_id",
"bug"+bugNum+"_mc", bugNum,
{_x:randRange(50, 500), _y:randRange(50, 350)});
thisBug.onRelease = function() {
this.removeMovieClip();
};
bugNum++;
}
See also
duplicateMovieClip function, createEmptyMovieClip
(MovieClip.createEmptyMovieClip method)
, duplicateMovieClip
(MovieClip.duplicateMovieClip method)
, attachMovie (MovieClip.attachMovie
method)
, swapDepths (MovieClip.swapDepths method)
_rotation (MovieClip._rotation property)
public _rotation : Number
Specifies the rotation of the movie clip, in degrees, from its original orientation. Values from 0
to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise
rotation. Values outside this range are added to or subtracted from 360 to obtain a value
within the range. For example, the statement
my_mc._rotation = 450 is the same as
my_mc._rotation = 90.
Availability: ActionScript 1.0; Flash Lite 2.0

Table of Contents

Related product manuals