movieclip描边控制


class Border extends MovieClip {
private var borderClip:MovieClip;
public var x:Number;
public var y:Number;
public var width:Number;
public var height:Number;
public function Border() {
createEmptyMovieClip("borderClip", 1000);
x = this._x;
y = this._y;
width = this._width;
height = this._height;
}
public function makeBorder():Void {
with (borderClip) {
lineStyle(0, 0xff0000, 100);
beginFill(0xff6600,20);
moveTo(this.x, this.y);
lineTo(this.x + this.width, this.y);
lineTo(this.x + this.width, this.y + this.height);
lineTo(this.x, this.y + this.height);
lineTo(this.x, this.y);
endFill();
}
}
public function removeBorder():Void {
borderClip.clear();
}
public function onRollOver():Void {
swapDepths(10000);
makeBorder();
}
public function onRollOut():Void {
removeBorder();
}
public function onDragOut():Void {
removeBorder();
}
public function onPress():Void {
this.startDrag();
}
public function onRelease():Void {
stopDrag();
}
public function onReleaseOutside():Void {
stopDrag();
}
}

你可能感兴趣的:(cli)