This content has been marked as final. Show 10 replies
I would use the 'scale9Grid' movieclip property, where as when applied to a movieclip the rounded corners will not deform. An easy way to use this property, if you can, would be to use it on a movieclip symbol in the library where you can adjust the grids during author-time. Here is a link from the livedocs;
Thank you, I will look at it...
I have to create a rectangle to use the scale9grid, and there is one thing that I don't understand: If I create the rectangle for example like this:
var grid:Rectangle = new Rectangle(20, 20, 10, 10); , then it works well, the corners don't deform. But if I create the rectangle for example this way:
var grid:Rectangle = new Rectangle(20, 20, 20, 20); , then it doesn't work well, the corners deform. So what should I write to the place of the four property of the Rectangle (_width, _height, _x, _y)? What do they assign?
The parameters for the Rectangle constructor are below;
public Rectangle(x:Number, y:Number, width:Number, height:Number)
To see more about this class hit F1 in Flash to pull up the helpdocs. Look in;
ActionScript 2.0 Language Reference>ActionScript classes > Rectangle (flash.geom.Rectangle) > Rectangle constructor
The parameters are clear for me (I think), but I don't understand how these parameters effect the scale9grid. It isn't in the help I think. So I don't know what to write to the place of the _x, _y, _width, and _height parameters, because I don't know how they are in connection with the scaling.
I believe that the 4 parameters correspond to the 4 points of the center square/rectangle. Think of a tic-tac-toe board’s center square or a touch tone pad’s center button (usually number 5), Now each of these have 4 corners/points. Those are the 4 points I am referring too. The scaling does not happen in the corner squares.
If you create a symbol and enable the scale9grid property to it, you can see hairlines that represent where it will scale.
You don't need scale9Grid': the scael parameter in the api drawing works out...
Look for the "scale type parameter"....
Thank you, now I understand how the scale9Grid works. One more thing: It works well with the borders, but the rounded corners of the rounded fill of the rounded rectangle (hehe, funny phrase) scale normally. So the scale9Grid doesn't work with fills just with lines?
I have found the answer for my question. I read the help contents absently. By now it works well. Thank you for your help!
za beezo does make a valid point. I didn’t know they added those params for Flash Player 8. But if you are doing any kind of asymmetric scaling, use the scale9grid property.