📄 newirisinstance.as
字号:
package tree
{
import mx.effects.effectClasses.MaskEffectInstance
import mx.controls.SWFLoader;
public class NewIrisInstance extends MaskEffectInstance {
public var position:String;
public function NewIrisInstance(target:Object) {
super(target);
}
//*
override protected function initMaskEffect():void{
super.initMaskEffect();
var targetWidth:Number = targetVisualBounds.width / Math.abs(target.scaleX);
var targetHeight:Number = targetVisualBounds.height / Math.abs(target.scaleY);
if (target is SWFLoader){
targetWidth = target.contentWidth;
targetHeight = target.contentHeight;
}
if (showTarget){
scaleXFrom = 0;
scaleYFrom = 0;
scaleXTo = 1;
scaleYTo = 1;
if(position == "leftTop"){
xFrom = targetVisualBounds.x;
yFrom = targetVisualBounds.y;
}else if(position == "rightBottom"){
xFrom = targetWidth+ targetVisualBounds.x;
yFrom = targetHeight + targetVisualBounds.y;
}else{
xFrom = targetWidth / 2 + targetVisualBounds.x;
yFrom = targetHeight / 2 + targetVisualBounds.y;
}
xTo = targetVisualBounds.x;
yTo = targetVisualBounds.y;
}else{
scaleXFrom = 1;
scaleYFrom = 1;
scaleXTo = 0;
scaleYTo = 0;
xFrom = targetVisualBounds.x;
yFrom = targetVisualBounds.y;
if(position == "leftTop"){
xTo = targetVisualBounds.x;
yTo = targetVisualBounds.y;
}else if(position == "rightBottom"){
xTo = targetWidth + targetVisualBounds.x;
yTo = targetHeight + targetVisualBounds.y;
}else{
xTo = targetWidth / 2 + targetVisualBounds.x;
yTo = targetHeight / 2 + targetVisualBounds.y;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -