11 Replies Latest reply on May 22, 2009 12:09 PM by kglad

    Need help understanding ripple effect code from different designer

    moonglyttr Level 1

      I'm hoping someone can help me decipher this code. I'm a web designer, but I deal with HTML, PHP, JavaScript, not so much ActionScript. I have a new client, and they've already had a website designed completely in Flash. Now they only want certain elements of it, and the rest in HTML. The problem, is that I don't know much about ActionScript and I'm having a hard time figuring out how to make it do what I want.

       

      See, the website uses the ripple effect to make images and text look as if you were sticking your finger in water - it follows the mouse. So, I want to take 3 different smaller Flash movies out of this huge, big one. But when I do, the ripple effect no longer works. Here is the action code:

       

       

      import flash.display.BitmapData;

      var map1:BitmapData = new BitmapData(900, 600, true, 0xFF0000);

      this.createEmptyMovieClip("bmp1", 10);
      bmp1.attachBitmap(map1, 0, "auto", true );

      var blur = new flash.filters.BlurFilter(8,8,5);

      var mapPoint = new flash.geom.Point(0,0);
      var dmfr = new flash.filters.DisplacementMapFilter(map1,mapPoint,1,1,-30,-30,"clamp",0,1);

      this.createEmptyMovieClip("cont1", 200);
      cont1._visible = false;

      bmp1.filters = [blur];

      bmp1._visible = false;

      onMouseMove = function()
      {
      var d = cont1.getNextHighestDepth();
      var mc1 = cont1.attachMovie("circle", "c"+d, d);
      mc1._x = this._xmouse;
      mc1._y = this._ymouse;
      mc1.cacheAsBitmap = true;
      };

      water_effect.onEnterFrame = function()
      {
      map1.draw(cont1);
      map1.draw(bmp1);
      this.filters = [dmfr];
      };

       

       

      I know I'll need to change L2 - the 900 to whatever width and the 600 to whatever height, but that's about all I understand.

       

      If anyone can help, please let me know ASAP. I'm not asking you to do any work, just maybe at least point me in the right direction.