Flash fader effect (actionscript 3)

Here another piece of code about a collection of fader effects.

It’s beautiful what we can do with filters and bitmapData class. A stupid animation can become deeper and immersive. I’ve to integrate something with music, like the Winamp AVS. I’m thinking about a QX game, using this two concepts… A sort of rhythm and game and arcade game… Bah... maybe in the future.
Ecco un altro po' di codice sugli effetti fader. È interessante come una semplice stupida animazione può guadagnare profondità, con un semplice effetto di questo tipo. Mi piacerebbe integrare qualcosa con la musica, tipo gli effetti del winamp. Mi piacerebbe realizzare un gioco tipo QX (chi se lo ricorda?), ma più incentrato sull'aspetto musicale. Quindi per poter giocare ad un gioco simile sarebbe utile soprattutto il senso del ritmo... boh, comunque vedremo.

Here a "Strar Wars" tribute:

package
{
  import flash.display.*;
  import flash.events.*;
  import flash.filters.*;
  import flash.geom.*;
  import flash.ui.*;
  import flash.utils.*;

  public class Plasma extends MovieClip
  {
      var canvas:Bitmap;
      var plasma:MovieClip;
      var fader:ColorChanger;
      var blurFilter:BlurFilter;
      var bkgd:BitmapData;

      public function Plasma() : void
      {
          bkgd = new BitmapData(1000, 900, true, 4278190080);
          canvas = new Bitmap(bkgd);
          plasma = new MovieClip();
          blurFilter = new BlurFilter(1, 2, 1);
          fader = new ColorChanger();
          fader.alpha = 1;
   fader.x = 500;
   fader.y = 350;
   fader.scaleX = fader.scaleY = .6
          addChild(plasma);
          plasma.addChild(canvas);
          plasma.addChild(fader);
          addEventListener(Event.ENTER_FRAME, activateVisual);
          return;
      }

      private function activateVisual(param1:Event) : void
      {
   fader.rotation+=.5
   bkgd.applyFilter(bkgd, bkgd.rect, new Point(0, 0), blurFilter);

          bkgd.draw(plasma);
  
          return;
      }
  }
}

0 comments:

Posta un commento