1

如何使用 actionscript 在 4 个角上创建一个 5 像素的圆形蒙版来动态屏蔽我的 flash 电影?(角落应该是透明的,其余的应该是可见的)

谢谢!

4

1 回答 1

4

可能就是这么简单。在 Flash 中制作一个圆角矩形并将其命名为 myMovie。

面具

mask = myMovie;

绘制圆角矩形在舞台上制作电影

//550x400 stage
var roundRect:Shape = new Shape();
roundRect.graphics.beginFill(0x006600, 1);
//stage width, stage height, width of rectangle, height of rectangle, ellipse width, ellipse height
roundRect.graphics.drawRoundRect(125, 75, 300, 200, 25, 25);
addChild(roundRect);
//mask
mask = roundRect;

将面具和电影放在舞台上“类名 Rr 和 Ym 的符号”

//550x400 stage
//put mask on stage
var mm:MovieClip = new Rr;
addChild(mm);
//position on stage
mm.x = stage.stageWidth/4;
mm.y = stage.stageWidth/4;
//mask
mask = mm;
//put movie on stage
var yourClip:MovieClip = new Ym;
addChild(yourClip);
//position on stage
yourClip.x = stage.stageWidth/4;
yourClip.y = stage.stageWidth/4;
于 2010-05-05T17:15:54.527 回答