⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newirisinstance.as

📁 《Flex第一步:基于ActionScript 3.0的Flex 2应用开发》采用概念讲解与实例结合的方式
💻 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 + -