이번에는 오른쪽 8칸의 표에 대한 설명입니다.

아래를 복사하여 실행하고 검토하십시오.

 

 

// puzzleBoardClip.fla

var puzzleBoardClip:MovieClip;

 

init();

function init(){

            puzzleBoardClip = new MovieClip();

            addChild(puzzleBoardClip);

}

 

makePuzzleBoard(400, 267);

// makePuzzleBoard(puzzleBmp.width, puzzleBmp.height);를 값으로

 

function makePuzzleBoard(width:Number, height:Number):void{

            var widthPuzzlePiece:Number = width / 4;

            var heightPuzzlePiece:Number = height / 2;

           

            var puzzleBoardSpaceClip:MovieClip;

            var x:Number = 0;

            var y:Number = 0;

           

           

            for(var i:Number = 0; i < 8; i++)

            //i 값을 0부터 7까지 8번 반복하면서, 8칸의 표를 만든다.

            {

                        puzzleBoardSpaceClip = new MovieClip();

                        puzzleBoardSpaceClip.graphics.lineStyle(0);

                        puzzleBoardSpaceClip.graphics.beginFill(0xFFFFFF,100);

                        puzzleBoardSpaceClip.graphics.lineTo(widthPuzzlePiece,0);

                        puzzleBoardSpaceClip.graphics.lineTo(widthPuzzlePiece,heightPuzzlePiece);

                        puzzleBoardSpaceClip.graphics.lineTo(0,heightPuzzlePiece);

                        puzzleBoardSpaceClip.graphics.lineTo(0,0);

                        puzzleBoardSpaceClip.graphics.endFill();

                         /*

                        아래 설명 참조.

                        영문입니다. 영어가 짧아도, 번역 보다는 원문이 나을 수도 있네요.

                        */

 

                        puzzleBoardSpaceClip.x = x;

                        puzzleBoardSpaceClip.y = y;

                        x += widthPuzzlePiece;

 

 

                         // 2번째 줄을 만드는 조건

                        if(x >= width)

                        {

                                   x = 0;

                                   y += heightPuzzlePiece;

                        }

                       

                        puzzleBoardClip.addChild(puzzleBoardSpaceClip);

            }

           

            puzzleBoardClip.x = 350;

            puzzleBoardClip.y = 200 - puzzleBoardClip.height/2;

            // 시작 좌표

}

 

 

설명

 

lineStyle(thickness:Number, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false,

scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 3)

 

thickness:Number— An integer that indicates the thickness of the line in points; valid values are 0 to 255.

If a number is not specified, or if the parameter is undefined, a line is not drawn.

If a value of less than 0 is passed, the default is 0.

The value 0 indicates hairline thickness; the maximum thickness is 255.

If a value greater than 255 is passed, the default is 255.

 

color:uint (default = 0) — A hexadecimal color value of the line; for example, red is 0xFF0000,

blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black). Optional.

 

alpha:Number (default = 1.0) — A number that indicates the alpha value of the color of the line;

valid values are 0 to 1. If a value is not indicated, the default is 1 (solid).

If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

 

pixelHinting:Boolean (default = false) — A Boolean value that specifies whether to hint strokes to full pixels.

This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true,

Flash Player hints line widths to full pixel widths.

With pixelHinting set to false, disjoints can appear for curves and straight lines.

For example, the following illustrations show how Flash Player renders two rounded rectangles

that are identical, except that the pixelHinting parameter used in the lineStyle() method

is set differently (the images are scaled by 200%, to emphasize the difference):

If a value is not supplied, the line does not use pixel hinting.

scaleMode:String (default = "normal") — A value from the LineScaleMode class

that specifies which scale mode to use:

·  LineScaleMode.NORMAL—Always scale the line thickness when the object is scaled (the default).

·  LineScaleMode.NONE—Never scale the line thickness.

·  LineScaleMode.VERTICAL—Do not scale the line thickness if the object is scaled vertically only.

For example, consider the following circles, drawn with a one-pixel line,

and each with the scaleMode parameter set to LineScaleMode.VERTICAL.

The circle on the left is scaled vertically only, and the circle on the right is scaled both vertically

and horizontally:

·  LineScaleMode.HORIZONTAL—Do not scale the line thickness if the object is scaled horizontally only.

For example, consider the following circles, drawn with a one-pixel line, and each

with the scaleMode parameter set to LineScaleMode.

HORIZONTAL. The circle on the left is scaled horizontally only,

and the circle on the right is scaled both vertically and horizontally:

 

caps:String (default = null) — A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are: CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated,

Flash uses round caps.

For example, the following illustrations show the different capsStyle settings. For each setting,

the illustration shows a blue line with a thickness of 30 (for which the capsStyle applies),

and a superimposed black line with a thickness of 1 (for which no capsStyle applies):

 

joints:String (default = null) — A value from the JointStyle class that specifies the type of joint appearance

used at angles. Valid values are:

JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND.

If a value is not indicated, Flash uses round joints.

For example, the following illustrations show the different joints settings.

For each setting, the illustration shows an angled blue line

with a thickness of 30 (for which the jointStyle applies), and a superimposed angled black line with a thickness of 1 (for which no jointStyle applies):

Note: For joints set to JointStyle.MITER, you can use the miterLimit parameter to limit the length of the miter.

 

miterLimit:Number (default = 3) — A number that indicates the limit at which a miter is cut off.

Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255).

This value is only used if the jointStyle is set to "miter".

The miterLimit value represents the length that a miter can extend beyond the point

 at which the lines meet to form a joint. The value expresses a factor of the line thickness.

For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

For example, consider the following angled lines, each drawn with a thickness of 20,

but with miterLimit set to 1, 2, and 4. Superimposed are black reference lines showing the meeting points

of the joints:

Notice that a given miterLimit value has a specific maximum angle for which the miter is cut off.

The following table lists some examples:

 

miterLimit value:

Angles smaller than this are cut off:

1.414

90 degrees

2

60 degrees

4

30 degrees

8

15 degrees

 

 

beginFill(color:uint, alpha:Number = 1.0)

color:uint— The color of the fill (0xRRGGBB).

alpha:Number (default = 1.0) — The alpha value of the fill (0.0 to 1.0).

 

lineTo(x:Number, y:Number)

x:Number— A number that indicates the horizontal position relative to the registration point

of the parent display object (in pixels).

y:Number— A number that indicates the vertical position relative to the registration point

of the parent display object (in pixels).

 

endFill()

Applies a fill to the lines and curves that were added since the last call to the beginFill(), beginGradientFill(),

or beginBitmapFill() method. Flash uses the fill that was specified in the previous call to the beginFill(),

beginGradientFill(), or beginBitmapFill() method.

If the current drawing position does not equal the previous position specified

in a moveTo() method and a fill is defined, the path is closed with a line and then filled.

이 게시물을..