Return to Snippet

Revision: 30669
at August 19, 2010 03:57 by derrekwayne


Initial Code
package com.neonsunburst {

	import flash.events.*;
	import flash.display.MovieClip;
	import com.gskinner.motion.GTween;
	import com.gskinner.motion.easing.*;
	import com.neonsunburst.*;

	public class Main extends MovieClip {
		
		var model:Model;
		var controller:Controller;
		var _content:Content;
		var navigation:Navigation;
		
		public function Main () {
			
			model= new Model();
			controller = new Controller(model);
			_content = new Content(model);
			navigation = new Navigation(model, controller);

			grad.alpha = 0;
			//device.photo.alpha = 1;
			device.shaddow.alpha = 1;
			
			contentHolder.addChild(_content);
			
			stage.addEventListener(MouseEvent.MOUSE_OVER, engage);
			stage.addEventListener(Event.MOUSE_LEAVE, unEngage);

			arrowHolder.addChild(navigation);
		}

		function engage(e:MouseEvent) : void {
			//grad.alpha = 1;
			new GTween(grad, .5, {alpha:1}, {ease:Sine.easeOut});
			new GTween(device.photo, .5, {alpha:0}, {ease:Sine.easeIn});
			new GTween(contentHolder, .5, {alpha:1}, {ease:Sine.easeIn});
			
			device.shaddow.alpha = 1;
			//device.photo.alpha = 0;
			
			navigation.activate();
			_content.engage();
			
			stage.removeEventListener(MouseEvent.MOUSE_OVER, engage);
		}
		
		function unEngage(e:Event) : void {
			//grad.alpha = 0;
			new GTween(grad, .5, {alpha:0}, {ease:Sine.easeIn});
			new GTween(device.photo, .5, {alpha:1}, {ease:Sine.easeIn});
			//new GTween(contentHolder, .5, {alpha:0}, {ease:Sine.easeIn});
			
			device.shaddow.alpha = .3;
			//device.photo.alpha = 1;
			
			navigation.unActivate();
			_content.unEngage();
			
			stage.addEventListener(MouseEvent.MOUSE_OVER, engage);
		}
	}
}

Initial URL
neonsunburst.com

Initial Description
The Main class uses the MCV design pattern. The entire flash embed responds to mouseover with the engage function.

Initial Title
Neonsunburst DocumentClass

Initial Tags
actionscript

Initial Language
ActionScript 3