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

📄 zoom.as

📁 我在08年11月利用flex3.0 mxml和as3.0设计的一个3D相册,用到trans matrix和一些控件 6个源码文件 具体效果请看 http://www.macs.hw.ac.u
💻 AS
字号:
// ActionScript file
import mx.containers.Panel;
import mx.controls.TextArea;

public var boolIsZoom:Boolean 	= false; 
public var zoomPict:Picture 	= null; 
public var zoomPictZ:int = 0;
public var zoomPictWidth:int 	= 0; 
public var zoomPictHeight:int 	= 0; 
public var myText:TextArea;
public var myPanel:Panel;
public function onImageMouseClick(e:Event):void
		{
		
		trace(boolIsZoom);
			if(boolIsZoom)
			{
				removeChild(myPanel);
				zoomPict.width  = zoomPictWidth; 
				zoomPict.height = zoomPictHeight;		
				zoomPict.zpos   = zoomPictZ;	
				boolIsZoom   	= false;
				zoomPict	    = null;	
				//to let the picture back to its position when zoom it in			
				this.addEventListener(Event.ENTER_FRAME, onEnterFrame); 
			}
			
			else
		  {
				//(stop pictures rotation and make the picture which zoomed out in the middle of screen)		   
				var pic:Picture = e.currentTarget as Picture;
				//stop pictures rotation
				this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);  
				//make the picture which zoomed out in the middle of screen
				//pic.x=0;
				//pic.y=0;                     
				zoomPict 		= pic;
				zoomPictZ       = pic.zpos;
				
				var detailLoader:URLLoader = new URLLoader();						//
				detailLoader.addEventListener(Event.COMPLETE, detailLoaded);		//	store text data
				var detailURL:String = "../Details/Detail"+(pic.index + 1).toString()+".txt"	//	in picture class
				var detailURLReq:URLRequest = new URLRequest(detailURL);			//
				detailLoader.load(detailURLReq);	
				
				function detailLoaded(e:Event):void  {
				myText = new TextArea;
				myPanel = new Panel;
				myPanel.x = (3*xBound)/4;
				myPanel.y = yBound/4;
				myPanel.height = (2*yBound)/3;
				myPanel.width = xBound/4;
				myText.text = new String(e.target.data);
				myText.x = 0;
				myText.y = 0;
				myText.percentHeight = 100;
				myText.percentWidth = 100;
				myText.horizontalScrollPolicy = "false";
				myPanel.addChild(myText);
				addChild(myPanel);
				//trace("picText");
				}								//

				//to bring any picture to the front
                pic.zpos =-250;
                //to back the picture which zoomed out to it z posision
                sortZ();    				
				pic.width 	= (2*(1.33 * yBound))/3;
				pic.height 	= (2*yBound)/3;
				
				pic.x = (xBound/2) - (pic.width/2);
				pic.y = (yBound/2) - (pic.height/2);
				boolIsZoom 	= true;//(to make the picture which zoomed out zoom in again	
				
			}	
		}

⌨️ 快捷键说明

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