Neonsunburst Content Class


/ Published in: ActionScript 3
Save to your folder(s)

The Content class is a view that listens to the model.


Copy this code and paste it in your HTML
  1. package com.neonsunburst {
  2.  
  3. import flash.display.MovieClip;
  4. import flash.events.*;
  5. import com.gskinner.motion.GTween;
  6. import com.gskinner.motion.easing.*;
  7.  
  8. public class Content extends MovieClip{
  9.  
  10. var model:Model;
  11.  
  12. public function Content (aModel:Model)
  13. {
  14. model = aModel;
  15. model.addEventListener(Event.CHANGE, update);
  16. }
  17. public function update(event:Event) : void {
  18. trace (this + " model updated");
  19. new GTween(this.slides.getChildAt(model.getCurrentPage() - 1), .5, {alpha:1}, {ease:Sine.easeIn});
  20. new GTween(this.slides.getChildAt(model.getPreviousPage() -1), .5, {alpha:0}, {ease:Sine.easeIn});
  21. }
  22. public function engage() : void {
  23. new GTween(this.hifiA, .5, {alpha:0}, {ease:Sine.easeIn});
  24. }
  25. public function unEngage() : void {
  26. new GTween(this.hifiA, .5, {alpha:1}, {ease:Sine.easeIn});
  27. }
  28. }
  29. }

URL: neonsunburst.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.