2006/03/14 | scale9Grid实例
类别(Flash&AS2) | 评论(0) | 阅读(166) | 发表于 13:01
Flash8里的scale9Grid确实不错,将一个mc或者button切成9网格来进行缩放.
代码如下:
import flash.geom.Rectangle;
import flash.geom.Matrix;
this.createEmptyMovieClip("my_mc", this.getNextHighestDepth());
var grid:Rectangle = new Rectangle(20, 20, 260, 260);
my_mc.scale9Grid = grid;
my_mc._x = 50;
my_mc._y = 50;
function onMouseMove()
{
  my_mc._width = _xmouse;
  my_mc._height = _ymouse;
}
my_mc.lineStyle(20, 0xff3333, 100);
//var gradient_matrix:Matrix = new Matrix();
//gradient_matrix.createGradientBox(15, 15, Math.PI, 10, 10);
//my_mc.beginGradientFill("radial", [0xffff00, 0x0000ff], [100, 100], [0, 0xFF], gradient_matrix, "reflect", "RGB", 0.9);
my_mc.moveTo(0, 0);
my_mc.lineTo(0, 300);
my_mc.lineTo(300, 300);
my_mc.lineTo(300, 0);
my_mc.lineTo(0, 0);
my_mc.endFill();


Flash 动画
0

评论Comments

日志分类
首页[116]
Flash&AS2[56]
FMS[3]
Flex&AS3[5]
Asp[5]
My Works[13]
My Life[34]