var lbl:TextField = bevel_mc.createTextField("label_txt", 10, 0,
lineLength + 20, lineLength, 20);
lbl.autoSize = "center";
lbl.text = "bevel";
Flash uses the Drawing API to draw three triangles on the Stage. Each triangle has a
different value for its joint style.
3.
Save the Flash document and select Control > Test Movie to test the document.
Setting line miter (miterLimit)
The
property is a numerical value that indicates the limit at which a miter joint
miterLimit
(see
"Setting line caps (capsStyle) and joints (jointStyle)" on page
value is a general multiplier of a stroke. For example, with a value of 2.5,
miterLimit
is cut off at 2.5 times the stroke size. Valid values range from 0 to 255 (if a value
miterLimit
for
is
miterLimit
undefined
if
is set to
jointStyle
Using Drawing API methods and scripting animation
You can combine the Drawing API with the Tween and TransitionManager classes to create
some excellent animated results, and you only have to write a small amount of ActionScript.
The following procedure loads a JPEG image and dynamically masks the image so you can
reveal the image slowly after it loads by tweening the image's mask.
To animate dynamic masks:
1.
Create a new Flash document and save it as dynmask.fla.
2.
Add the following ActionScript to Frame 1 of the Timeline:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._visible = false;
// Center the image on the Stage.
target_mc._x = (Stage.width - target_mc._width) / 2;
target_mc._y = (Stage.height - target_mc._height) / 2;
var maskClip:MovieClip = target_mc.createEmptyMovieClip("mask_mc",
20);
with (maskClip) {
// Draw a mask that is the same size as the loaded image.
beginFill(0xFF00FF, 100);
moveTo(0, 0);
lineTo(target_mc._width, 0);
lineTo(target_mc._width, target_mc._height);
554
Animation, Filters, and Drawings
, the default value is
.
miter
551) is cut off. The
). The
3
miterLimit
property is only used
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?