Monthly ArchiveMay 2006



Action Script & Tutorials 26 May 2006 03:23 am

MovieClip point 2 point mover class

This class is based on Colin Moock Follow Grid of Point script.
With this class you can generate movement of movieclip from an array that contain some coordinat points.

Actionscript:
  1. //
  2. // save it as moveToPoint.as in janumedia folder
  3. //
  4. class janumedia.moveToPoint {
  5.    
  6.     private var pathArray:Array;
  7.     private var mc:MovieClip;
  8.    
  9.     function moveToPoint(t:MovieClip,pathTo:Array,speed:Number){
  10.        
  11.         pathArray   = pathTo;
  12.         drawPath(t,pathArray);
  13.         mc      = t;
  14.         mc.count    = 0;
  15.         mc.oldT  = getTimer();
  16.         mc.speed    = speed;
  17.         mc.oriX  = mc._x;
  18.         mc.oriY  = mc._y;
  19.         mc.xPos  = pathTo[mc.count].x;
  20.         mc.yPos  = pathTo[mc.count].y;
  21.         mc.owner    = this;
  22.         mc.onEnterFrame = function(){
  23.             this.owner.doMove();
  24.         }
  25.        
  26.     }
  27.    
  28.     private function doMove(){
  29.         mc.curT = getTimer();
  30.         mc.elapsedSeconds = (mc.curT - mc.oldT) / 1000;
  31.         mc.oldT = mc.curT;
  32.         mc.moveDist = mc.speed * mc.elapsedSeconds;
  33.         // Determine distance between clip and destination
  34.         var deltaX = mc._x - mc.xPos;
  35.         var deltaY = mc._y - mc.yPos;
  36.         var dist = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
  37.    
  38.         if (mc.moveDist>= dist) {
  39.             mc._x = mc.xPos;
  40.             mc._y = mc.yPos;
  41.             mc.count++;
  42.             if(mc.count <pathArray.length){
  43.                 mc.xPos  = pathArray[mc.count].x;
  44.                 mc.yPos  = pathArray[mc.count].y;
  45.             } else {
  46.                 delete mc.onEnterFrame;
  47.             }
  48.        
  49.         } else {
  50.             // Allocate speed between x and y axes
  51.             var moveX = mc.moveDist * (deltaX / dist);
  52.             var moveY = mc.moveDist * (deltaY / dist);
  53.             // Move follower towards the destination.
  54.             mc._x -= moveX;
  55.             mc._y -= moveY;
  56.         }
  57.     }
  58.    
  59.     private function drawPath(t:MovieClip,data:Array){
  60.         var path = t._parent.createEmptyMovieClip("mcpath",t._parent.getNextHighestDepth(),{_x:0,_y:0});
  61.         with(path){
  62.             clear();
  63.             lineStyle(0, 0x000000, 50);
  64.             moveTo(t._x, t._y);
  65.         }
  66.         for(var i=0 ; i<data.length ; i++){
  67.             path.lineTo(data[i].x, data[i].y);
  68.         }
  69.     }
  70. }

Don't forget to download the sample here

Action Script & Tutorials 19 May 2006 06:57 am

The Sources beeing shared

Inspired by Herdiansah, I would like to shared also some of my code which are most of them are already published in any Flash Community.
Since this is still relatively new hosting then still just a few sources there but will increase soon :) . C'moon get it here. Use it but don't abused it.

Flex 17 May 2006 04:18 am

Flex Builder 2 for Flash Programmers Presentation at DivNet

Today I found a nice article as Breeze presentation at DivNet about Flex Builder 2 for Flash Programmers.

Here the general out line about the presentation:

1rst hour:

  • Brief discussion of Flex
  • Tour of the Flex Builder 2 IDE
  • Description of an MXML component
  • Containers for layout speed
  • Basic events

2nd hour:

  • Component states
  • ViewStacks as application screens
  • Simple effects
  • Q & A

If you love to play on Flex I think you must watch this presentation at Breeze Seminar

Flash Platform 17 May 2006 04:10 am

Bitmapdata / Image Compression Techniques Solutions for Flash 8

Maybe you already know that we can save bitmap data into image file in flash 8 by using bitmapdata class. Mario Klingemann also did is with his BitmapExporter class.
The problem when you try to do save / sent bitmap data from flash to server is the compression. If you try to sent large data to server oftenly (each minute) then your server will do complex job to parsing the data into image and some times your flash will look or may be hang because of it. The solutions for this thing is compression rules!
Talking about the compression Koen De Weggheleire has a great idea about it. He explained to us about how we can compress the image data as well as RLE and LZW compression. With this method you even can have compression ratio 1.56. wow!!

[ via Peter Elst ]

Ajax 16 May 2006 05:28 am

30 Links to AJAX Tutorials

Very helfull link by Max Kiesler about Round-up of 30 AJAX tutorials. This list also you be found at Ritesh Jariwala's blog.

Here the 30 links:

AJAX Client-Server Communication Tutorials

AJAX Drag and Drop Tutorials

AJAX Form Tutorials

AJAX File Uploader Tutorial

AJAX Framework and Toolkit Tutorials

Ajax Getting Started Tutorial

Ajax Image Gallery Tutorial

Ajax Keyword Suggest Tutorials

AJAX Live Search Tutorials

Ajax Rounded Corner Tutorials

Ajax Sorting Tutorial

Ajax Tabbed Pages Tutorials

Flash Lite 16 May 2006 04:44 am

Introduction to Animation in Flash Lite 1.1 at DevCenter

It doesn't matter Flash Lite now in ver 2.0. But this article still help a lot for Flash Moblie / Lite developer. So don't miss it
Introduction to Animation in Flash Lite 1.1

Flash Platform 12 May 2006 02:41 am

Adobe Apollo : Flash beyond the browser

Has informed before that Adobe currently develop software project to replace of Macromedia Central. The product with codename Apollo will make Flash run outside browser is the same like Macromedia Central but should be more advanced :) .

Apollo programs will function when a person is offline and automatically update data when the user gets back online. For example, a person could book an airline ticket from a handheld or laptop offline; when the person reconnects to a network, the software will complete the transaction.
Apollo is designed to give developers a way to create applications that can render Flash animations as well as HTML and Acrobat files (PDF). That approach preserves the benefits of the Web but allows room for programs that can't be included now, Lynch said.

Read complete article at c|net

Uncategorized 03 May 2006 04:49 am

Selamat Hari Raya Galungan & Kuningan

Hari ini tanggal 3 Mei 2006 umat Hindu merayakan Hari Raya Galungan sebagai ucapan rasa syukur karena telah berhasil memenangkan sifat-2 baik terhadap sifat-2 buruk selama 210 hari terkahir. Perayaan ini akan berlanjut sepuluh hari mendatang yaitu sabtu 13 Mei 2006 akan dilanjutkan dgn perayaan Hari Raya Kuningan.
Untuk itu untuk semua sodara dan rekan umat Hindu saya ucapkan:

"Selamat Hari Raya Galungan dan Kuningan Semoga selalu dalam berkat-Nya"