/ Published in: ActionScript 3
The Content class is a view that listens to the model.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package com.neonsunburst { import flash.display.MovieClip; import flash.events.*; import com.gskinner.motion.GTween; import com.gskinner.motion.easing.*; public class Content extends MovieClip{ var model:Model; public function Content (aModel:Model) { model = aModel; model.addEventListener(Event.CHANGE, update); } public function update(event:Event) : void { trace (this + " model updated"); new GTween(this.slides.getChildAt(model.getCurrentPage() - 1), .5, {alpha:1}, {ease:Sine.easeIn}); new GTween(this.slides.getChildAt(model.getPreviousPage() -1), .5, {alpha:0}, {ease:Sine.easeIn}); } public function engage() : void { new GTween(this.hifiA, .5, {alpha:0}, {ease:Sine.easeIn}); } public function unEngage() : void { new GTween(this.hifiA, .5, {alpha:1}, {ease:Sine.easeIn}); } } }
URL: neonsunburst.com