/ Published in: ActionScript 3
The Main class uses the MCV design pattern. The entire flash embed responds to mouseover with the engage function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); } } }
URL: neonsunburst.com