Example
The following example rotates two buttons on the Stage. Create two buttons on the Stage
called
and
control_btn
see it rotating. Then enter the following ActionScript in Frame 1 of the Timeline:
var control_btn:Button;
var my_btn:Button;
control_btn.onRelease = function() {
my_btn._rotation += 10;
};
Now create another button on the Stage called
round (so you can see it rotate). Enter the following ActionScript in Frame 1 of the Timeline.
var myOther_btn:Button;
this.createEmptyMovieClip("rotater_mc", this.getNextHighestDepth());
rotater_mc.onEnterFrame = function() {
myOther_btn._rotation += 2;
};
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
See also
_rotation (MovieClip._rotation property)
property)
scale9Grid (Button.scale9Grid property)
public scale9Grid : Rectangle
The rectangular region that defines the nine scaling regions for the button. If set to
entire button is scaled normally when any scale transformation is applied.
When you define a
scale9Grid
nine regions based on the
There are eight other regions of the grid, as follows:
The area in the upper-left corner outside of the rectangle
The area above the rectangle
The area in the upper-right corner outside the rectangle
The area to the left of the rectangle
The area to the right of the rectangle
The area in the lower-left corner outside the rectangle
. Make sure that
my_btn
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
property for a button, the button is divided into a grid with
rectangle, which defines the center region of the grid.
scale9Grid
is not perfectly round, so you can
my_btn
, making sure it isn't perfectly
myOther_btn
,
_rotation (TextField._rotation
method.
, the
null
Button
369
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?