home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / net / xinterface / dwall / samples / xmlGallerySample / XmlWallSample.as < prev   
Encoding:
Text File  |  2010-06-23  |  3.1 KB  |  101 lines

  1. package net.xinterface.dwall.samples.xmlGallerySample
  2. {
  3.    import caurina.transitions.Equations;
  4.    import mx.core.Application;
  5.    import mx.core.UIComponent;
  6.    import net.xinterface.dwall.core.business.DWallQuality;
  7.    import net.xinterface.dwall.core.events.DataChangeEvent;
  8.    import net.xinterface.dwall.core.events.DataRequest;
  9.    import net.xinterface.dwall.core.views.DWallMainView;
  10.    import net.xinterface.dwall.core.views.items.PhotoItem;
  11.    
  12.    public class XmlWallSample extends UIComponent
  13.    {
  14.       public var view:DWallMainView;
  15.       
  16.       private var model:XMLPicModel;
  17.       
  18.       private var itemClass:Class = PhotoItem;
  19.       
  20.       protected var noPhotoImageClass:Class = XmlWallSample_noPhotoImageClass;
  21.       
  22.       private var source:String;
  23.       
  24.       public function XmlWallSample()
  25.       {
  26.          super();
  27.       }
  28.       
  29.       protected function DataChangedHandler(param1:DataChangeEvent) : void
  30.       {
  31.          this.view.removeEventListener(DataRequest.PAGE_REQUEST,this.model.RequestData);
  32.          this.model.removeEventListener(DataChangeEvent.CHANGE,this.DataChangedHandler);
  33.          this.view.AddData(param1.ItemList);
  34.          this.view.Start();
  35.       }
  36.       
  37.       public function stopRendering() : void
  38.       {
  39.          this.view.Stop();
  40.       }
  41.       
  42.       protected function ConfigureView() : void
  43.       {
  44.          this.view = new DWallMainView(Application.application.width,Application.application.height - 50,false);
  45.          addChild(this.view);
  46.          this.view.viewport.x = -50;
  47.          this.view.viewport.autoClipping = true;
  48.          addChild(this.view.viewport);
  49.          this.view.Reflect = true;
  50.          this.view.ReflectMargin = 70;
  51.          this.view.ItemWidth = 140;
  52.          this.view.ItemHeight = 100;
  53.          this.view.ItemMargin = 80;
  54.          this.view.ItemsXColumn = 3;
  55.          this.view.Quality = DWallQuality.STANDARD;
  56.          this.view.ZCamDefault = -500;
  57.          this.view.ZCamZoomed = -350;
  58.          this.view.CamAceleration = 10;
  59.          this.view.Inertia = 2;
  60.          this.view.camera.z = 0;
  61.          this.view.DebugMode = false;
  62.          this.view.MouseAceleration = 3;
  63.          PhotoItem.backgroundColor = 10066329;
  64.          PhotoItem.noPhotoImageClass = this.noPhotoImageClass;
  65.          PhotoItem.reflectionRatio = 200;
  66.          PhotoItem.reflectionAlpha = 0.2;
  67.          PhotoItem.noPhotoIsInteractive = false;
  68.          PhotoItem.borderColor = 0;
  69.          PhotoItem.easingEquation = Equations.easeInOutQuart;
  70.       }
  71.       
  72.       private function Init() : void
  73.       {
  74.          this.ConfigureView();
  75.       }
  76.       
  77.       public function get View() : DWallMainView
  78.       {
  79.          return this.view;
  80.       }
  81.       
  82.       public function startRendering() : void
  83.       {
  84.          this.view.Start();
  85.       }
  86.       
  87.       public function addData(param1:Array) : void
  88.       {
  89.          this.view.AddData(param1);
  90.          this.view.Start();
  91.       }
  92.       
  93.       public function set Source(param1:String) : void
  94.       {
  95.          this.source = param1;
  96.          this.Init();
  97.       }
  98.    }
  99. }
  100.  
  101.