Application of Flash 8 Scale9grid

Source: Internet
Author: User
You can use the Flash8 scale9grid to zoom in on the specified component style to facilitate user interface operation, and you can also apply it to graphics and design elements.

In previous versions, you might want to do a lot of code that looks superfluous now when you zoom in on a rounded corner.


With the new features of Flash8, you can define Scale9grid. Make this the ratio of rounded corners, and only zoom the center area, below you see is the use of the example:

Note that if there are fonts or other sub-MC in the MC, even though they are not in the zoom area, they still need to scale normally.

There are two ways to activate Scale9grid in Flash8. One is in the Flash8 Library panel and the other is using ActionScript. To activate the use of Scale9grid.

One. Define Scale9grid in the library.

Let's look at the first one:

1. Create a rounded rectangle in flash, and then convert it to MovieClip.

2. Select it in the library panel. Right-click to open its Properties panel.

3. Activate the checkbox below the panel, if the Panel is basic, click the Advanced button to open the advanced. The following figure.

4. Next you double-click the MovieClip to enter its edit state. You need to edit its area, just move the dotted line and edit its location. The following figure

It should be noted that SCALE9 can only be applied to movieclip. Because Scale9gride is the movie attribute class.

Second, define Scale9grid in ActionScript

The second way you might make the action to define the MovieClip scale9 attribute.

1. Create a new document.

2. Select the Rectangle tool, select the rounded corner to be 15, and draw a rounded rectangle. In this case, the size is 355*210

3. Converts it to an MC and is named SCALE_MC.

4. Add the following code to the first frame of the frame.

Import Flash.geom.Rectangle;
Scale_mc.img.attachMovie ("logo", "Logo1", this.getnexthightestdepth ());
var grid:rectangle = new Rectangle (15, 15, 335, 205);
Scale_mc.scale9grid = grid;
scale_mc._x = 50;
Scale_mc._y = 50;

function OnMouseMove () {
Scale_mc._width = _xmouse;
Scale_mc._height = _ymouse;
}

The first line we import the class. The third line defines the Scale9 area, and line fourth specifies SCALE9.

If you want to cancel Scale9, you need to define it I don't have a defined state, such as scale_mc.scale9grid=undefined



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.