`
dcdc723
  • 浏览: 187399 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

flash环绕效果

    博客分类:
  • flex
阅读更多
package 
{

	//AS3
	import flash.display.*;
	import flash.events.*;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.utils.Dictionary;
	import flash.geom.Matrix;
	import flash.text.TextField;
	import flash.text.StyleSheet;	
	import flash.net.*;
	
	//Import  papervision 3D
	import org.papervision3d.scenes.*;
	import org.papervision3d.cameras.*;
	import org.papervision3d.objects.*;
	import org.papervision3d.materials.*;
	import org.papervision3d.*;
	import caurina.transitions.*;
	
	//  Main script class
	public class script extends MovieClip
	{
		//___________________________________________________________3d vars
		
		private var scene:MovieScene3D;
		private var camera:Camera3D;
		private var container:Sprite;
		private var camzoom:Number = 5;
							
		
		//__________________________________________________________Gallery vars
		
		private var numphot:Number = 1; 	// Number of photos
		private var radius:Number = 600;	// radius of circle makes the carousel
		private var cradius:Number = 1100;	// cradius of camera rotate around, should be larger than radius
		private var angle:Number = 0;
		private var anglePer:Number = new Number();
		private var anglePD:Number = new Number();
	
		//__________________________________________________________XML vars
		
		private var xmlLoader:URLLoader = new URLLoader();
		private	var xmlData:XML = new XML();
		private var xml_path:String = "data.xml";	// xml_path
		
		//__________________________________________________________Gallery Data
		
		private var thumb:Array = new Array();
		private var capt:Array = new Array();
		private var desc:Array = new Array();
		private var link:Array = new Array();
		private var img:Array = new Array();
		
		// Plane infro
		private var planeDoubleSide:Boolean = false;
		private var planeSmooth:Boolean = false;
		private var quality:Number = 1;
		
		// Easing/Movement parameters
		private var mtime:Number = 2.5;	//duration movement of camera
		private var mtime2:Number = 1;	//duration movement of thumbnail when roll over
		private var mtime3:Number = 1.5;	//duration movement of thumbnail when pressed
		
		// Cam/Image easing type
		private var Cam_easeType:String = "easeOutQuint";
		private var Img_easeType:String = "easeOutQuint";
		private var Img_easeType2:String = "easeOutQuint";
		
		//Distance from origin position when moving out
		private var moveDistance:Number = 100; 
		
		// Auto rotate
		private var autorotate:Boolean = true;
		private var rotatespeed:Number = 0.002;
		private var rs:Number = 0.002;
		private var pitch:Number = 0.075;
		private var Pitch:Number = 0.075;
		
		// Alpha, transparency
		private var Alpha:Number = 1;
		
		// Reflection
		private var reflection:Boolean = true;
		private var refDist:Number = 180;  	//Distance from image to its corresponding reflection
		private var refIn1:Number = 0.5;	// Reflection Intensity 1
		private var refIn2:Number = 0;		// Reflection Intensity 2
		private var refDen1:Number = 0;		// Reflection Density 1
		private var refDen2:Number = 180;	// Reflection Density 2
		private var refSmooth:Boolean = false;	// Smooth Reflection
		private var refDoubleSide:Boolean = false;	// 2 side Reflection
		
		// Camera Infor
		private var COB:Object = new Object();
		private var camPos:Object = new Object();
		private var camHeight:Number = 0;
		
		private var tPos:Object = new Object();
		private var delta1:Number = 0.325;
		private var delta2:Number = 200;
		
		// Navigation Style
		private var nagStyle:String = "Mouse";
		
		// Description, Caption Data
		private var cTime:Number = 1; 	//Caption fade in, fade out
		private var dTime:Number = 1; 	//Description fade in, fade out
		private var cTrans:String = "linear"; 	//Transition type
		private var dTrans:String = "easeOutQuint";		//Transition type
		
		// Misc variables
		private var flag:uint = 0;
		private var loaded:Boolean = false;
		private var big_loaded:Array = new Array();
		private var neededScale:Boolean = true;
		private var RollOvered:Boolean = false;
		
		private var count:Number = 0;
		private var count2:Number = 0;
		private var tloaded:Number = 0;
		private var cID:Number = 0;	//Current images
		private var pInfor:Dictionary = new Dictionary();
		private var	pContainer:Dictionary = new Dictionary();
		private var	imgInfor:Dictionary = new Dictionary();
		private var	ImgContainer:Array = new Array();
		
		// Style Sheet
		private var css:StyleSheet = new StyleSheet();
		
		//______________________________________________________________________Main script
		//Constructor
		public function script():void
		{
			// Block Papervison3D trace output
			Papervision3D.VERBOSE = false;
			
			// Initial 3d environment
			Init();
			
			// Create 3d gallery
			Create_gallery();
		}
		
		// Setup data
		private function Init():void
		{
			// Align , scale Stage to full fill screen
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			// Reposition element if stage is resized
			stage.addEventListener(	Event.RESIZE, rePosition)
			
			//Create container Sprite for scene 3d
			container = new Sprite();
			container.visible = false;
			addChild( container );
			
			container.x = stage.stageWidth * 0.5;
			container.y = stage.stageHeight * 0.5;
			
			// Movie Scene 3D
			scene = new MovieScene3D( container );
			
			// Camera 3D
			camera = new Camera3D();
			camera.zoom = camzoom;
			
			// Camera first position 
			camera.x = cradius;
			camera.z = 0;
			camera.y = camHeight;
			COB.angle = 0;
			camPos.angle = 0;
			
			// Reposition 
			cap.x = (stage.stageWidth - cap.width) * 0.5 ;
			des.x = container.x + 40;
			des.y = (stage.stageHeight - des.height) * 0.5  + 20;
			
			// invisible descripton
			des.visible = false;
			
			// temporary remove caption, description to solve z order issue
			removeChild(cap);
			removeChild(des);
			
			// Setup preloader
			preloader.x = 0;
			preloader.y = (stage.stageHeight - preloader.height) * 0.5 ;
			preloader.width = stage.stageWidth;
			preloader.bar.scaleX = 0;
			
			// Initialize description
			InitDescription();
			
			// for preview only
			Setup_link();
		}
		
		// Start to build gallery
		private function Create_gallery():void 
		{
			// Load data from XML
			XML_Loading();
			
			//Adding events, renderCamera
			this.addEventListener(Event.ENTER_FRAME, update3D);
		}
	
		
		//__________________________________________________________XML load 
		
		private function XML_Loading():void
		{
			xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
			xmlLoader.load(new URLRequest( xml_path ));
		}
		
		private function LoadXML(e:Event):void 
		{
			//Extract data
			xmlData = new XML(e.target.data);
			ParseData(xmlData);
		}
		
		private function ParseData(dat:XML):void
		{
			//Number of photos
			numphot = dat.photos.photo.length();
		
			// Add Enterframe event for preloader
			preloader.addEventListener(Event.ENTER_FRAME, preload);
			
			anglePer = (360/numphot) * Math.PI/180;
			anglePD = (360/numphot);
			
			for (var i:uint = 0; i<numphot; i++)
			{
				thumb[i] = dat.photos.photo.thumb.attributes()[i];
				capt[i] = dat.photos.photo.caption.attributes()[i];
				desc[i] = dat.photos.photo.desc.text()[i];
				link[i] = dat.photos.photo.link.attributes()[i];
				img[i] = dat.photos.photo.img.attributes()[i];
				big_loaded[i] = 0;
			}
			Load_thumbnail();
		}
			
		
		//Load external assest
		private function Load_thumbnail():void
		{
			for (var i:uint = 0; i<numphot; i++)
			{
				var myLoader:Loader = new Loader();
				var myRequest:URLRequest = new URLRequest(thumb[i]);
				myLoader.load(myRequest);
				myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, Thumb_loaded);
				pInfor[myLoader] = i;
			}
		}
		
		//Loading thumbnails
		private function Thumb_loaded(e:Event):void
		{
			var myOb = e.target.loader;
			
			//Bitmap Material
			var bmp:BitmapData = new BitmapData( myOb.width, myOb.height, true, 0x000000 );
			bmp.draw(myOb);
			
			var bm:BitmapMaterial = new BitmapMaterial(bmp);
			bm.doubleSided = planeDoubleSide;
			bm.smooth = false;
			bm.name = "front";
			
			// Materials
			var materials:MaterialsList = new MaterialsList(
			{
				back:  new MovieAssetMaterial( "BACK", true ),
				front: bm
			} );
			
			var insideFaces  :int = Cube.FRONT + Cube.BACK;
	
			// Create a plane or cube with depth = 1
			var p:Cube= new Cube( materials, myOb.width, 1, myOb.height, quality, 1, quality, insideFaces );
			var index = pInfor[myOb];
			
			scene.addChild( p, "plane" + index );
					
			// Setting up the plane contains corresponding picture
			// Extracting the corresponding index
			
			// Additional data, for roll over, roll out movement purpose
			p.extra = {
				tPos:new Object,
				cPos:new Object,
				oPos:new Object,
				ref:new Plane(),
				index:new Number,
				rotationY:new Number
			}
			
			// Calculate original position
			p.x = Math.cos( index * anglePer) * radius;
			p.z = Math.sin( index * anglePer) * radius;
			p.rotationY = ( -index * anglePer) * (180/Math.PI) + 270;
			
			p.extra.oPos.x = p.x;
			p.extra.oPos.z = p.z;
			
			p.extra.cPos.x = p.x;
			p.extra.cPos.z = p.z;
			
			p.extra.tPos.x = Math.cos( index * anglePer) * (radius + moveDistance);
			p.extra.tPos.z = Math.sin( index * anglePer) * (radius + moveDistance);
			
			p.extra.index = index;
			p.extra.rotationY = p.rotationY;
			
			count++;
			tloaded++;
			
			//Check if all thumbnails are loaded
			if (count == numphot)
			{
				//Load images
				for (var i:uint = 0; i < numphot; i++)
				{
					var myLoader:Loader = new Loader();
					var myRequest:URLRequest = new URLRequest(img[i]);
					myLoader.load(myRequest);
					myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, Img_loaded);
					imgInfor[myLoader] = i;
				}
			}
			
			
			//______________________________________________________________Make Reflection
			if (reflection) 
			{
				// Create new reflection Bitmap Data 
				var bmp2:BitmapData = new BitmapData( myOb.width, myOb.height, true, 0x000000);
				
				// Flip vertical
				var m:Matrix = new Matrix();
				m.createBox(1, -1, 0, 0, myOb.height);
				bmp2.draw( bmp, m );
				
				//Reflection Bitmap Object
				var b2:Bitmap = new Bitmap(bmp2);
				
				// Reflection mask
				m.createGradientBox(myOb.width, myOb.height,Math.PI/2,myOb.height);
				var mymask:Shape = new Shape();
				mymask.graphics.lineStyle(0,0,0);
				mymask.graphics.beginGradientFill("linear", [0x000000, 0x000000],[refIn1, refIn2], [refDen1, refDen2],m) ;
				mymask.graphics.lineTo(0, myOb.height);
				mymask.graphics.lineTo(myOb.width, myOb.height);
				mymask.graphics.lineTo(myOb.width, 0)
				mymask.graphics.lineTo(0, 0)
				mymask.graphics.endFill();
				
				// CacheaAsBitmap
				mymask.cacheAsBitmap = true;
				b2.cacheAsBitmap = true;
				
				// Create mask
				b2.mask = mymask;
				
				addChild(b2);
				addChild(mymask);
				
				var bmp3:BitmapData = new BitmapData(myOb.width, myOb.height, true, 0x000000);
				bmp3.draw(b2);
				
				// Create Reflection plane
				var bm2:BitmapMaterial = new BitmapMaterial(bmp3);
				bm2.doubleSided = refSmooth;
				bm2.smooth = refDoubleSide;
				var p2:Plane = new Plane(bm2, 1, 0, 2, 2);
				
				p2.x = Math.cos( index * anglePer) * radius;
				p2.z = Math.sin( index * anglePer) * radius;
				p2.y = - refDist;
				p2.rotationY = ( -index * anglePer) * (180/Math.PI) + 270;
				
				scene.addChild(p2);
				removeChild(b2);
				removeChild(mymask);
				p.extra.ref = p2;
			}		
			
			//Sprite contains thumbnails
			var container:Sprite = p.container;
			
			// Setting Alpha value of thumbnails
			container.alpha = Alpha;
			container.buttonMode = true;
			
			// Roll over, roll out, press event
			container.addEventListener(MouseEvent.ROLL_OVER, RollOver);
			container.addEventListener(MouseEvent.ROLL_OUT, RollOut);
			container.addEventListener(MouseEvent.MOUSE_DOWN, Press);		
			pContainer[container] = p;
		}
		
		
		//___________________________________________________________Preloader
		
		private function preload(e:Event):void
		{
			var preloader = e.target;
			var bar = preloader.bar;
			bar.scaleX += (tloaded / (2 * numphot) - bar.scaleX) * 0.1;

			if (bar.scaleX >= 0.95) {
				bar.scaleX = 1;
				//Fade out preloader
				Tweener.addTween( preloader, {	alpha:0, 
								 				time:1, 
												transition:"easeOutExpo", 
												onComplete:function():void {
													
													//remove preloader ~ load complete
													removeChild(preloader)
													
													// Fade in screen
													container.visible = true;						
													container.alpha = 0;
													Tweener.addTween( container, {alpha:1, time:1, transition:"easeOutExpo" } );
													
													// Add caption , desciption
													addChild(cap);
													addChild(des);
												}
												});
				
				// remove Enterframe event for preloader
				preloader.removeEventListener(Event.ENTER_FRAME, preload);
			}
		}
		
		private function Img_loaded(e:Event):void
		{
			var img = e.target.loader;
			
			// Make reference for further using
			ImgContainer[imgInfor[img]] = img;
			
			//Scale down and hide image
			img.scaleX = 0;
			img.scaleY = 0;
			img.alpha = 0;
			addChild(img);	
			
			// increase total loaded
			tloaded++;
		}
			
		//______________________________________________Thumbnail Roll Over, Roll Out, Press
		//Thumb roll over
		private function RollOver(e:Event):void
		{
			var p:Cube = pContainer[e.target];
			var ob:Object = {	x:p.extra.tPos.x,
								z:p.extra.tPos.z,
								time: mtime2,
								transition:Img_easeType,
								onUpdate: updatePos,
								onUpdateParams: [p]
							}
			Tweener.addTween(p.extra.cPos, ob );
			
			var index = p.extra.index;
			
			// Tween Caption:Fade In/Fade Out
			var FadeIn:Function = function(index:Number):void
			{
				cap.text = capt[index];
				Tweener.addTween(cap, {alpha:1, time: (cTime/2), transition:cTrans});
			}
			Tweener.addTween(cap, {alpha:0, time: (cTime/2) , transition:cTrans, onComplete: FadeIn, onCompleteParams:[index]});
		}
	
		// Thumb roll out	
		private function RollOut(e:Event):void
		{
			var p:Cube = pContainer[e.target];
			var ob:Object = {	x:p.extra.oPos.x,
								z:p.extra.oPos.z,
								time: mtime2,
								transition:Img_easeType,
								onUpdate: updatePos,
								onUpdateParams: [p]
							}
			Tweener.addTween(p.extra.cPos, ob );
		}
		
		
		// Thumb pressed
		private function Press(e:Event):void
		{
			var container = e.target;
			var p = pContainer[container];
				
			if (flag == 0) 
			{
				//Prevent roll over, roll out tween
				container.removeEventListener(MouseEvent.ROLL_OVER, RollOver);
				container.removeEventListener(MouseEvent.ROLL_OUT, RollOut);
				
				cap.alpha = 1;
				des.visible = true;
				rs = 0;
				pitch = 0;
				
				for (var i:uint = 0; i < numphot; i++)
				{
					if ( i != p.extra.index) 
					{
						var pl = scene.getChildByName("plane"+i);
						pl.container.removeEventListener(MouseEvent.ROLL_OVER, RollOver);
						pl.container.removeEventListener(MouseEvent.ROLL_OUT, RollOut);
						pl.container.removeEventListener(MouseEvent.MOUSE_DOWN, Press);	
						pl.container.buttonMode = false;
						
						//_____________________________________________________________________
						
						//Add tweening alpha - Optional
						Tweener.addTween(pl.container, {alpha:0, time:2, transition:"easeOutQuint"});
						Tweener.addTween(pl.extra.ref.container, {alpha:0, time:2, transition:"easeOutQuint"});
									
						//______________________________________________________________________
						
						//Add tweening scale - Optional
						/*
						Tweener.addTween(pl.container, {scaleX:0, scaleY:0, time:2, transition:"easeOutQuint"});
						Tweener.addTween(pl.extra.ref.container, {scaleX:0, scaleY:0, time:2, transition:"easeOutQuint"});
						*/
					}
				}
				
				var tob:DisplayObject3D = new DisplayObject3D();
				tob.x = delta1 * (1 - camera.x) + camera.x;
				tob.z = delta1 * (-camera.z) + camera.z;
				tob.rotationY = (-angle % 360) + 270;
				
				tob.moveLeft(delta2);
				tPos.x = tob.x;
				tPos.z = tob.z;
				tPos.rotationY = tob.rotationY;
				
				var myob:Object = {	x:tPos.x, 
									z:tPos.z, 
									y:0,
									rotationY:tPos.rotationY, 
									time:mtime3, 
									transition:Img_easeType2, 
									onUpdate:updatePos2, 
									onUpdateParams: [p]
									};
									
				// Move thumbnail to target position
				Tweener.addTween( p, myob);
				
				// Move Camera
				Tweener.addTween(camera, {y:0, time: dTime, transition:dTrans });
				
				//Fade In Description
				des.text = desc[p.extra.index];

				Tweener.addTween(des, {alpha:1, time: dTime, transition:dTrans, onComplete:AddEvent, onCompleteParams:[p]});
				cID = p.extra.index;
			}
			else
			{
				rs = rotatespeed;
				pitch = Pitch;
				
				// Plane smooth == false ~ increase performance
				p.getMaterialByName("front").smooth = false;
				
				container.removeEventListener(MouseEvent.ROLL_OVER, RollOver2);
				container.removeEventListener(MouseEvent.ROLL_OUT, RollOut2);
				stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
						
				var myob2:Object = {x:p.extra.oPos.x, 
									z:p.extra.oPos.z, 
									y:0,
									rotationY:p.extra.rotationY, 
									time:mtime3, 
									transition:Img_easeType2, 
									onUpdate:updatePos2, 
									onUpdateParams: [p],
									onComplete: RestoreEvent,
									onCompleteParams: [p]};
									
				// Move thumbnail back
				Tweener.addTween( p, myob2);
				
				for (var j:uint = 0; j < numphot;   j++)
				{
					if ( j != p.extra.index) 
					{
						var pl2 = scene.getChildByName("plane"+j);
						pl2.container.addEventListener(MouseEvent.ROLL_OVER, RollOver);
						pl2.container.addEventListener(MouseEvent.ROLL_OUT, RollOut);
						pl2.container.addEventListener(MouseEvent.MOUSE_DOWN, Press);	
						pl2.container.buttonMode = true;
						
						//______________________________________________________________
						
						//Add tweening alpha - Optional
						Tweener.addTween(pl2.container, {alpha:1, time:2, transition:"easeOutQuint"});
						Tweener.addTween(pl2.extra.ref.container, {alpha:1, time:2, transition:"easeOutQuint"});
									
						//______________________________________________________________
						
						//Add tweening scale - Optional
						
						/*
						Tweener.addTween(pl2.container, {scaleX:1, scaleY:1, time:2, transition:"easeOutQuint"});
						Tweener.addTween(pl2.extra.ref.container, {scaleX:1, scaleY:1, time:2, transition:"easeOutQuint"});
						*/
					}
				}
				
				// Move Camera Back
				Tweener.addTween(camera, {y:camHeight, time: dTime, transition:dTrans });
				
				//Fade Out Description
				Tweener.addTween(des, {alpha:0, time: dTime, transition:dTrans, onComplete:function():void {des.visible = false}});
				
				//Fade Out image
				neededScale = true;
				Tweener.addTween(ImgContainer[cID], {scaleX:0, scaleY:0, alpha:0, time:1, transition:"easeOutQuint" });
			}
			flag = Math.abs(flag-1);
		}
		
		
		//______________________________________________________________________
		// New roll over, roll out when a thumbnail is presed
		
		private function AddEvent(p:Cube):void
		{
			stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
			p.container.addEventListener(MouseEvent.ROLL_OVER, RollOver2);
			p.container.addEventListener(MouseEvent.ROLL_OUT, RollOut2);
						
			//Plane smooth == true ~ increase quality
			p.getMaterialByName("front").smooth = true;
		}
		
		private function RollOver2(e:Event):void
		{
			if (neededScale)
			{
				Tweener.addTween(ImgContainer[cID], {scaleX:1, scaleY:1, alpha:0.85, time:1, transition:"easeOutBack" });
				neededScale = false;
			}
			stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
		}
		
		private function RollOut2(e:Event):void
		{
			neededScale = true;
			Tweener.addTween(ImgContainer[cID], {scaleX:0, scaleY:0, alpha:0, time:1, transition:"easeOutQuint" });
			stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
		}
		
		private function MouseMove(e:Event):void
		{
			ImgContainer[cID].x = (stage.mouseX + 10) ;
			ImgContainer[cID].y = (stage.mouseY + 10);
		}
		
		
		//_______________________________________________________________Update position 
		
		private function updatePos(p:Cube):void
		{
			p.x = p.extra.cPos.x;
			p.z = p.extra.cPos.z;
			p.extra.ref.x = p.x;
			p.extra.ref.z = p.z;
		}
		
		private function updatePos2(p:Cube):void
		{
			p.extra.cPos.x = p.x;
			p.extra.cPos.z = p.z;
			p.extra.ref.x = p.x;
			p.extra.ref.z = p.z;
			p.extra.ref.rotationY = p.rotationY;
		}
		
		private function RestoreEvent(p:Cube):void
		{
			var container:Sprite = p.container;
			
			//Restore Roll Over, Roll Out
			container.addEventListener(MouseEvent.ROLL_OVER, RollOver);
			container.addEventListener(MouseEvent.ROLL_OUT, RollOut);
		}
			
		//________________________________________________________________________
		
		private function MoveCamera(k:Number):void
		{
			camPos.angle = k * anglePer;
			Tweener.addTween(COB, {angle: camPos.angle, time: mtime, transition:Cam_easeType, onUpdate:updateCamera});
		}
			
		private function updateCamera():void
		{
			var x = Math.cos( COB.angle) * cradius;
			var z = Math.sin( COB.angle) * cradius;
			camera.x = x;
			camera.z = z;
			angle = COB.angle * 180/Math.PI;
		}
		
		private function update3D(e:Event):void
		{
			if (autorotate) 
			{	
				var del = (stage.mouseX - stage.stageWidth * 0.5) * rs;
				//var del2 = (stage.stageHeight * 0.5 - stage.mouseY) * pitch;
				
				angle += del;
				var x = Math.cos(angle*Math.PI/180)*cradius;
				var z = Math.sin(angle*Math.PI/180)*cradius;
				
				camera.x = x;
				camera.z = z;
			}
			scene.renderCamera( camera );
		}
		
		private function rePosition(e:Event):void
		{
			container.x = stage.stageWidth * 0.5;
			container.y = stage.stageHeight * 0.5;
			
			// Reposition caption, description
			cap.x = (stage.stageWidth - cap.width) * 0.5 ;
			cap.y = container.y + 150;
			des.x = container.x + 40;
			des.y = (stage.stageHeight - des.height) * 0.5 + 20 ;
		}
		
		//__________________________________________Apply styleSheet in description field
		
		private function InitDescription():void
		{
			// load external css
			var req:URLRequest = new URLRequest("css/styles.css");
			var loader:URLLoader = new URLLoader();
			loader.load(req);
			loader.addEventListener(Event.COMPLETE, cssLoaded);
			// Adding text link event
			addEventListener(TextEvent.LINK, clickText);
		}
		
		private function cssLoaded(e:Event):void
		{
			css.parseCSS(e.target.data);
			des.styleSheet = css;
		}
		
		private function clickText(li:TextEvent):void
		{
			var myURL:URLRequest = new URLRequest(li.text);
			navigateToURL(myURL,"_blank");
		}
		
		//___________________________________for Preview only
		
		private function Setup_link():void
		{
			gal2.buttonMode = gal3.buttonMode = gal4.buttonMode = true;
			gal2.addEventListener(MouseEvent.MOUSE_DOWN, go2);
			gal3.addEventListener(MouseEvent.MOUSE_DOWN, go3);
			gal4.addEventListener(MouseEvent.MOUSE_DOWN, go4);
		}
		
		private function go2(e:Event):void
		{
			var myURL:URLRequest = new URLRequest("./3d2.html");
			navigateToURL(myURL,"_self");
		}
	
		private function go3(e:Event):void
		{
			var myURL:URLRequest = new URLRequest("./3d3.html");
			navigateToURL(myURL,"_self");
		}

		private function go4(e:Event):void
		{
			var myURL:URLRequest = new URLRequest("./3d4.html");
			navigateToURL(myURL,"_self");
		}

		
	}
}

 

分享到:
评论

相关推荐

    Flash制作环绕的立体图片效果动画

    本主题聚焦于“Flash制作环绕的立体图片效果动画”,这是一个将传统静态图片转化为具有3D视觉效果的动态展示方式,能为用户提供更丰富的交互体验。 首先,我们需要理解Flash的工作原理。Adobe Flash基于帧的动画...

    Flash_3D_360度环绕(支持中文)

    标题中的“Flash_3D_360度环绕(支持中文)”表明这是一个使用Flash技术创建的3D环绕展示项目,特别优化了对中文的支持。在3D空间中,这种技术通常用于实现产品展示或者场景浏览,让用户可以从各个角度查看对象,提供...

    利用css的clear属性实现广告文字环绕效果

    利用css的clear属性实现广告文字环绕效果_网页代码站(www.webdm.cn) ;"&gt; ;height:100px;width:1px;"&gt;&lt;!--一个宽为1px的空白层,利用该层的高度控制广告层上下的位置。--&gt; ;height:250px;width:250px;clear:left;...

    多文体图片展示,Flash 3D图片特效.rar

    标题中的“多文体图片展示,Flash 3D图片特效.rar”指的是一个使用Adobe Flash技术创建的3D图像展示程序,该程序具备动态效果,能够以多样的方式展示图片。这个程序利用了Flash的3D功能,为用户提供了一个交互式的...

    flash actionscript3+XML+SWFProfiler+PV3D制作环绕镜面相册.zip_actionscript入门

    总结起来,这个压缩包提供的资料将指导开发者如何综合运用ActionScript3、XML、SWFProfiler和PV3D来创建一个互动性强、视觉效果出众的环绕镜面相册。通过学习这个项目,不仅可以提升ActionScript3编程技能,还能掌握...

    Flash 3D球面滚动效果.rar

    这种球面滚动效果通常通过矩阵变换和3D坐标系统来实现,使图像在虚拟的球面上平滑滚动,给人一种立体环绕的感觉。 在描述中提到,这个压缩包包含多款圆形球面滚动特效,这意味着用户可以有多种选择,以适应不同的...

    WPS文字环绕制作.docx

    在 WPS 文字中制作文字环绕效果是一种创新的排版方式,可以为文档增添动态视觉效果,提升观众的阅读体验。以下将详细解释如何通过 WPS 演示文稿平台来实现这种环绕效果。 首先,我们需要理解文字环绕的本质是通过...

    flash球滚动字体.zip

    【标题】:“Flash球滚动字体”是一个与动画设计相关的主题,特指在Flash环境中实现的文字以球体形式滚动的效果。这种效果通常用于制作动态展示、网页元素或互动媒体设计,可以增加视觉吸引力并提升用户体验。 ...

    flash树的生长含flv源文件

    这个压缩包中的内容是关于"Flash树的生长含flv源文件",这意味着它包含了一段展示小树生长成大树并伴有树叶成长和蝴蝶环绕的动画效果。让我们深入探讨一下其中涉及的技术和知识点。 1. **Flash动画**:Flash是一种...

    Flash微粒旋转动画源文件.rar

    ActionScript是Flash平台上用来控制动画和交互的核心语言,通过编写ActionScript代码,开发者可以控制粒子的运动轨迹、速度、大小、颜色以及旋转方向等特性,使粒子按照特定的方式旋转并环绕在一个圆圈中。...

    flex-3D图像环绕虚拟现实代码

    本篇文章将深入探讨如何利用Flex实现3D图像环绕和180度摄影机镜头变换效果,为3D图像演示开发提供有价值的参考。 首先,我们需要理解Flex的核心——ActionScript 3.0。这是一种强大的面向对象的编程语言,支持高级...

    61种flash 字体特效源文件下载

    立体效果应该不是FLASH 做出来的,利用其他的软件把文体做好,然后再导入FLASH 里输出成动画;(103KB) 42,around.zip 旋转文字 一款文字围绕球体旋转,产生立体效果的动画;(4KB) 43,bigm.zip 摇摇字 其实是...

    Flash动感文字制作软件

    "Flash动感文字制作软件"指的是利用Flash来创建动态、吸引人的文字效果。这些效果通常包括文字的渐变、旋转、缩放、闪烁以及其他复杂的运动轨迹,能够为网站、广告或多媒体演示增添视觉冲击力。 Flash的工作基于...

    环绕形的Flash菜单

    环绕形的Flash菜单是一种视觉效果独特、交互性强的网页元素,常用于网站导航,能吸引用户的注意力并提供直观的操作体验。这种菜单设计通常基于ActionScript编程,是Flash动画技术的应用,能够实现动态的360度环绕...

    FLASH AS3 3D引擎

    总的来说,Flash AS3 3D引擎是将3D技术融入Web应用的有力工具,尽管面临挑战,但其丰富的功能和独特的3D环绕效果仍使其在某些场景下具有不可替代的优势。对于有志于深入研究3D编程的开发者来说,掌握这一技术无疑能...

    flash360全景展示代码

    3. **360度全景图像处理**: 全景图像是由多张照片拼接而成的,通常需要使用专门的软件(如PTGui、Hugin等)进行拍摄角度校正、无缝拼接,形成一个完整的360度环绕视图。 4. **全景图坐标系统**: 在Flash中实现360...

    360度全景图展示FLASH源码

    在360度全景图的制作过程中,首先需要拍摄一系列环绕目标的图像,然后使用专业软件(如PTGui、Panorama Tools等)进行图片拼接,生成一张全景图。接下来,使用Flash开发工具(如Flash Professional或Flex Builder)...

    3D旋转的Flash图片展示特效.rar

    3D旋转的Flash图片展示特效,运行后会360度不停旋转,鼠标放上去后停止旋转,移开后继续旋转,XML是配置文件,Fla文件已打包。

    显示为圆形的Flash焦点图特效.rar

    "圆形的Flash焦点图特效"是指在一个圆形布局中,通过点击环绕在图片边缘的按钮,实现图片的切换,这种切换方式呈现出扇形的动画效果,既美观又能够引导用户的视线。它通常用于网站的首页,用来展示重要的产品或服务...

Global site tag (gtag.js) - Google Analytics