Monthly ArchiveJune 2006



Flash Platform 14 Jun 2006 08:37 am

Awesome Adobe Apollo Sceenshot

While waiting the release date of Adobe Apollo which are predicted will release by the end of 2006. The screenshot of Adobe Apollo that was presented by Luis Pollanco during the session “Building Killer RIAs? Meet: Adobe’s Next-Gen Technology” at Adobe Developer Week. Most of demo applications were build using Flex Builder. So here they are the screenshot which are taken from Ryan Stewart’s blog site


Apollo Tunes


Apollo Tunes Visualization


Apollo Transparency Demo


Apollo Travel Application

More about Adobe Apollo also you can find it here.
Thanks to Ryan Stewart for share the screenshots :)

Action Script & Tutorials 01 Jun 2006 02:39 am

Slide Show Tween Class for dynamic Image Gallery

Last week I wrote this class for a flash site development. Since the data is dynamic then I must wrote the code for dynamic slide show gallery also and here the class that i wrote:

Actionscript:
  1. // slide show tween class
  2. class janumedia.fx.tween {
  3.    
  4.     private var mc:MovieClip; // target mc
  5.     private var img1:MovieClip; // mc1
  6.     private var img2:MovieClip; // mc2
  7.     private var data:Array; // image gallery
  8.     private var speed:Number; // tween speed interval
  9.     private var cur:Number; // current play
  10.     private var tw:Boolean; // tween status
  11.     private var intervalID;
  12.    
  13.     function tween(t:MovieClip,d:Array,s:Number){ // t = movieclip target ; d = image list in array ; s = swening speed interval
  14.         mc  = t;
  15.         data    = d;
  16.         speed   = s;
  17.         cur = 0;
  18.         tw            = false;
  19.         prepared();
  20.     }
  21.     private function prepared(){
  22.         mc.createEmptyMovieClip("img1",10);
  23.         mc.createEmptyMovieClip("img2",9);
  24.         img1 = mc.img1;
  25.         img2 = mc.img2;
  26.  
  27.         loadImage(img1,nextImage());
  28.         loadImage(img2,nextImage());
  29.        
  30.     }
  31.     private function beginTween(n:MovieClip){
  32.         clearInterval(intervalID);
  33.         //trace("begin tween "+n);
  34.                                 n.owner = this
  35.         switch(n){
  36.             case img1 :
  37.                 //trace("img1");
  38.                 img2.onEnterFrame = function(){
  39.                     this._alpha -= self.speed;
  40.                     //trace(this._alpha);
  41.                     if(this._alpha <= 0) {
  42.                         this.swapDepths(9);
  43.                         this.owner.swapDepths(10);
  44.                         delete this.onEnterFame;
  45.                         this.owner.loadImage(this,this.owner.nextImage());
  46.                     }
  47.                 }
  48.                 break
  49.             case img2 :
  50.                 //trace("img2");
  51.                 img1.onEnterFrame = function(){
  52.                     this._alpha -= self.speed;
  53.                     if(this._alpha <= 0) {
  54.                         this.swapDepths(9);
  55.                         this.owner.img2.swapDepths(10);
  56.                         delete this.onEnterFame;
  57.                         this..owner.loadImage(this,this.owner.nextImage());
  58.                     }
  59.                 }
  60.                 break;
  61.         }
  62.     }
  63.     private function nextImage():String{
  64.         var n = cur;
  65.         cur++;
  66.         cur = cur>= data.length ? 0 : cur;
  67.         //trace("cur : "+cur+" : "+data[n]);
  68.         return data[n];
  69.     }
  70.     private function loadImage(t:MovieClip,img){
  71.         //trace("load : "+img+" to : "+t);
  72.         var self = this;
  73.         var my_mcl = new MovieClipLoader();
  74.         var myListener = new Object();
  75.         myListener.onLoadComplete = function (tmc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
  76.             tmc._alpha = 100;
  77.             if(self.tw) self.intervalID = setInterval(self,"beginTween",2000,tmc);
  78.             self.tw = true;
  79.         }
  80.         myListener.onLoadProgress = function(tmc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
  81.             var a = Math.round((bytesLoaded/bytesTotal)*100);
  82.             trace("load progress "+a);
  83.         }
  84.         my_mcl.addListener(myListener);
  85.         my_mcl.loadClip(img, t);
  86.     }
  87. }

To use is is very simple. Make sure you copy this code and save as tween.as in folder janumedia/fx.
Then ready to use with this code:

Actionscript:
  1. var myGallery = new Array("image1.jpg","image2.jpg","image2.jpg");
  2. var myslideshow = new janumedia.fx.tween(this, myGallery, 200);

The gallery list (array data) it self can be load dynamically using xml data

> Get the update version here