Return to Snippet

Revision: 68597
at January 27, 2015 19:47 by RodolfoMiranda


Updated Code
package com.db.banner {
	import com.greensock.TimelineLite;
	import com.greensock.TweenLite;
	import com.greensock.easing.Expo;
	import com.greensock.easing.Quint;

	import flash.display.LoaderInfo;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;

	// --- 
	public class Template extends Main {
		private var content : MovieClip;
		private var tl : TimelineLite;

		public function Template() {
			super();
			buttonMode = true;
			content = this;
			init();
		}

		// ----------------- init ---v
		public function init() : void {
			tl = new TimelineLite();
			addListeners();
			reset();
			animate();
		}

		// ----------------- event listeners ---v
		public function addListeners() : void {
			addEventListener(MouseEvent.CLICK, onClick);
		}
		// ----------------- clickTag ---v
		private function onClick(event : MouseEvent) : void {	
			navigateToURL(new URLRequest(LoaderInfo(root.loaderInfo).parameters.clickTag), "_blank");
		}
		
		// ----------------- animate ---v
		public function animate() : void {
			TweenLite.to(content.key, 1, {alpha:1});
//			tl.insert(TweenLite.to(content.myMC, 1, {y:0, ease:Expo.easeInOut}), 2);
//			tl.insert(TweenLite.to(content.myMC, 1, {y:0, ease:Quint.easeOut}), tl.duration() - 0.5);
//			tl.append(TweenLite.to(content.myMC, 1, {y:0, ease:Quint.easeOut}), -0.5);
	
		}
		
		// ----------------- reset ---v
		public function reset() : void {
			content.key.alpha = 0;
		}
		
	// This is the end... my only friend the end.
	
	}
}

Revision: 68596
at January 24, 2015 01:44 by RodolfoMiranda


Updated Code
package com.client.campaign {
	import com.greensock.plugins.TintPlugin;
	import com.greensock.easing.Circ;
	import com.greensock.TimelineLite;
	import com.greensock.TweenLite;
	import com.greensock.easing.Expo;
	import com.greensock.easing.Quint;
	import com.greensock.plugins.TransformAroundCenterPlugin;
	import com.greensock.plugins.ColorTransformPlugin; 
	import com.greensock.plugins.TweenPlugin;

	import flash.display.LoaderInfo;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;

	public class CreativeName_336x280 extends Main {
		private var contentMC : MovieClip;
		private var tl : TimelineLite;
		private var virgin : Boolean = true; 
		public var i :int = 0;

		public function CreativeName_336x280() {
			super();
			buttonMode = true;
			contentMC = this;
			init();
		}

		// ----------------- Init:
		public function init() : void {
			tl = new TimelineLite();
			addListeners();
			reset();
			animate();
		}

		// ----------------- Event listeners:
		private function addListeners() : void {
			addEventListener(MouseEvent.CLICK, onClick);
		}

                // ----------------- clickTag:
		private function onClick(event : MouseEvent) : void {
			navigateToURL(new URLRequest(LoaderInfo(root.loaderInfo).parameters.clickTAG), "_blank");
		}

		// ----------------- Animate:
		public function animate() : void {
			tl.insert(TweenLite.to(content.overlayIntro, 1.4, {alpha=0}), 1.2);
			tl.insert(TweenLite.to(content.copy001, 1, {y:50, ease:Quint.easeOut}), tl.duration() - 0.2);
			//trace(tl.duration());
		}
		
		// ----------------- Reset:
		public function reset() : void {
			content.overlayIntro.alpha = 1;
			
		}
		// ----------------- This is the end... my only friend.... the end!  
	}
}

Revision: 68595
at January 24, 2015 00:38 by RodolfoMiranda


Initial Code
package com.client.campaign {
	import com.greensock.plugins.TintPlugin;
	import com.greensock.easing.Circ;
	import com.greensock.TimelineLite;
	import com.greensock.TweenLite;
	import com.greensock.easing.Expo;
	import com.greensock.easing.Quint;
	import com.greensock.plugins.TransformAroundCenterPlugin;
	import com.greensock.plugins.ColorTransformPlugin; 
	import com.greensock.plugins.TweenPlugin;

	import flash.display.LoaderInfo;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;

	public class CreativeName_336x280 extends Main {
		private var contentMC : MovieClip;
		private var tl : TimelineLite;
		private var virgin : Boolean = true; 
		public var i :int = 0;

		public function CreativeName_336x280() {
			super();
			buttonMode = true;
			contentMC = this;
			init();
		}

		// ----------------- Init:
		public function init() : void {
			tl = new TimelineLite();
			addListeners();
			reset();
			animate();
		}

		// ----------------- Event listeners:
		public function addListeners() : void {
			addEventListener(MouseEvent.CLICK, onClick);
		}

                // ----------------- clickTag:
		private function onClick(event : MouseEvent) : void {
			navigateToURL(new URLRequest(LoaderInfo(root.loaderInfo).parameters.clickTAG), "_blank");
		}

		// ----------------- Animate:
		public function animate() : void {
			tl.insert(TweenLite.to(content.overlayIntro, 1.4, {alpha=0}), 1.2);
			tl.insert(TweenLite.to(content.copy001, 1, {y:50, ease:Quint.easeOut}), tl.duration() - 0.2);
			//trace(tl.duration());
		}
		
		// ----------------- Reset:
		public function reset() : void {
			content.overlayIntro.alpha = 1;
			
		}
		// ----------------- This is the end... my only friend.... the end!  
	}
}

Initial URL

                                

Initial Description
The basic structure As3 Class for producing a banner.

Initial Title
AS3 Class Basic Banner

Initial Tags

                                

Initial Language
ActionScript 3