dynamic class mycustommc extends MovieClip { //创建静态方法,大家可以查一查Object.registerClass()的用法 static function register() { Object.registerClass("__Packages.mycustommc", mycustommc); } function mycustommc() { this.beginFill(0xCCCCCC, 50); this.lineStyle(1, 0xFF0000, 100); this.moveTo(0, 0); this.lineTo(10, 0); this.lineTo(10, 10); this.lineTo(0, 10); this.endFill(); } function move(aX:Number, aY:Number) { this._x = aX; this._y = aY; } }