【发布时间】:2011-07-11 06:41:28
【问题描述】:
import flash.display.Shape;
import flash.display.Graphics;
stage.addEventListener(Event.ENTER_FRAME, startAnim);
function startAnim(e:Event):void
{
var shape1:Shape = new Shape();
shape1.graphics.beginFill(0x333333,1);
shape1.graphics.drawRect(40,50,250,125);
shape1.graphics.endFill();
addChild(shape1); // this will add a shape of rectangle to stage
}
这是一个在舞台上创建矩形的非常简单的函数。好的,但问题是我如何才能将此 SHAPE 转换为 MOVIECLIP 仅使用 ActionScript,以便我可以将事件添加到相同的 (shape1)。
【问题讨论】:
标签: actionscript-3 actionscript