labs.insert-title.com

Scripted Motion w/ easing

The Flash

The Script

	
function DrawBox(sName,fc,bc,w,h,x,y,dpth,opc,speed){
    ref = _root.createEmptyMovieClip(sName,dpth);    
    ref.lineStyle(0,0xFFFFFF,100);
    ref.moveTo(x,y);    
    ref.lineStyle(0,bc,opc);
    ref.beginFill(fc,opc);
    ref.lineTo(x+w,y);
    ref.lineTo(x+w,y+h);
    ref.lineTo(x,y+h);
    ref.lineTo(x,y); 
    ref.endfill();
    ref.xxx=24;
    ref.randomX = random(600);
    ref.randomY = random(300);                   
    ref.onEnterFrame = function(){
        this.xxx+=(random(2));
        this._X -= this.randomX;
        this._X *= 0.9;
        this._X += this.randomX;
        this._Y -= this.randomY;
        this._Y *= 0.9;               
        this._Y += this.randomY;
        if(this.xxx>50){
        this.xxx=1;
        this.randomX = random(600);
        this.randomY = random(300);}
            };
     ref.OnFrame(2) = function(){gotoandplay(1)}
}
onLoad(){
  i=30;
  for (t=0; t<=i; t++) {    
    DrawBox("box" + t,0x666666,0x000000,5,5,0,0,t,100,0.9) ;
  }
}

The Download

Download swish file





Discussion

Riyana

nice to see this.

hitkitz@yahoo.com

using swishMax it only shows one dot! no mutiple dots like the tutorial

hitkitz@yahoo.com

I found the solution! I will put a link in some of the forums I use to tell everyone about this great Tutorial!! wow this is some good stuff!!

Joe Maddalone

Thanks for the support.

The script above should, in fact generate 29 identical boxes. This happens in the "i=30; for (t=0; t<=i; t++) { ..." loop

MICHAL.

I like your script "Random Motion". I will be greatful if you could send me a little bit changed formula. I want to put on my website efect of flying insects. Your script is great for that in 100% but the dots can`t stop before next move it must be still in motion. APPRECIATE YOUR HELP. PS: SORY FOR MY ENGLISH:-)

Chici

Thanks 4 the tutorials I want to learn more bout swishmax Please give the full script of animation my e-mail qoechen35@yahoo.com

New comments are currently disabled, you can find me @joemaddalone Comments temporarily disabled for now, you can find me @joemaddalone