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

📄 shadow.as

📁 as3.0 翻书效果
💻 AS
字号:
/**
* Description here..
* @author Default
* @version 0.1
*/

package crlclr {
	import fl.transitions.Tween;
	import fl.transitions.easing.*;
	import flash.display.Sprite;
	
	public class Shadow extends Sprite {
		
		var ds1:Sprite;
		var ds2:Sprite;
		var ds3:Sprite;
		
		var ds4:Sprite;
		var ds6:Sprite;
		
		var ds7:Sprite;
		var ds8:Sprite;
		var ds9:Sprite;
		
		private var isVisiable:Boolean=true;
		private var isRight:Boolean=false;
		
		private var x1:int = 31;
		private var y1:int = 33;
		private var x2:int = 23;
		private var y2:int = 24;
		
		public function Shadow(w:int,h:int){
			
			var shadow:BShadow=new BShadow();
			
			this.delegate(shadow);
			
			this.addChild(shadow);
			
			this.setSize(w, h);
			
		}
		
		private function delegate(shadow:BShadow){
			
			ds2=shadow.ds2;
			ds3=shadow.ds3;
			
			ds4=shadow.ds4;
			ds6=shadow.ds6;
			
			ds7=shadow.ds7;
			ds8=shadow.ds8;
			ds9=shadow.ds9;
		}
		
		/**
		* 调整位置;
		* @param	w
		* @param	h
		*/
		private function setSize(w:int, h:int){
			var w2:int = w - x1 - x2;
			var h2:int = h - y1 - y2;
			
			ds2.width = w2;
			ds8.width = w2;
			ds3.x = x1 + w2;
			ds6.x = x1 + w2;
			ds9.x = x1 + w2;
			ds4.height = h2;
			ds6.height = h2;
			ds7.y = y1 + h2;
			ds8.y = y1 + h2;
			ds9.y = y1 + h2;
		}
		
		private function onResize(){
			
		}
		
		public function set Visiable(bool:Boolean):void{
			this.isVisiable=bool;
			var twn:Tween;		
			if(bool){
				
				twn=new Tween(this,"alpha",Regular.easeOut,this.alpha,1.0,1,true);
			}else{
				twn=new Tween(this,"alpha",Regular.easeOut,this.alpha,0,1,true)
			}
			
		}
		
		public function get Visiable():Boolean{
			return this.isVisiable;
		}
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -