• home
  • forum
  • my
  • kt
  • download
  • Tsunami Menu

    Author: 2007-06-06 13:48:18 From:

    Intro

     

    Here is an example of the type of Flash Menu effect that this tutorial will show you how to make. If you roll your mouse over the buttons below, you will see why it is called the Tsunami Menu:

     

    Example: Download the Flash file Int 107a

     

    Step One: Movie Clips

    Make any series of Movie Clips you wish to use as menu buttons for your Flash Movie

    .

    Here is what one of my Movie Clips looks like:

    Step Two: ActionScript Frame 1

    In the first frame of your movie, place the following actionscript:

    menutriggerdist=150;
    menumaxscale=300;
    menumultiplier=1.5;

    Line 1:

    menutriggerdist=150;


    This is the distance under which the movie clips will start to change scale and move.

    Line 2:

    menumaxscale=300;


    T

    his is the maximum scale for each clip.

    Line 3

    : menumultiplier=1.5;
    This is an arbitrary variable that affects the scaling rate.

    Step Three: ActionScript Movie Clip

    Click on any movie clips and attach the following actionscript:

    on (press) { // here starts normal movie clip event handlers


          getUrl("http://www.webwasp.co.uk");
    }

    on (rollOver) {
        this._alpha=100;
    }

    on (rollOut) {


       this._alpha=25;

    // here ends the normal movie clip event handlers
    }

    //sets event to mousemove or you'll get strange wobbling of your movie clips.
    onClipEvent (mouseMove) {

    //calculates distance from mouse to movie clip

    dist=Math.sqrt(Math.pow(Math.abs(_xmouse),2)+Math.pow(Math.abs(_ymouse), 2));

    // if within a certain distance, triggerdistance, then start changing the clips scale
       if (dist<=_root.menutriggerdist) {
          currscale=(1-(dist/(_root.menumultiplier*_root.menutriggerdist)))*(_root.menumaxscale-100);
          this._xscale = currscale;
          this._yscale = currscale;

     // if outside of triggerdistance, then make the scale equal to 100
       } else {
          this._xscale = 100;
          this._yscale = 100;
       }
    }

    Step Four: Movement

    If you wish your movie clips to move in a direction while scaling, edit the movie clip directly and move the objects of the movie clip away from the default registration point.

    If you wish the clip to move right, move the objects to the right, etc.

     

    discuss this topic to forum

    relation tutorial

    No information

    Category

      3D (36)
      Math Physics (18)
      3rd Party (10)
      Navigation (70)
      Actionscripting (228)
      Optimization (17)
      Animation (166)
      Projector (11)
      Audio (54)
      Special Effects (170)
      Backend (26)
      Text Effects (92)
      Drawing (34)
      Tips and Techniques (58)
      Dynamic Content (38)
      Tricks (8)
      Games (114)
      Utilities (24)
      Getting Started (99)
      Video (59)
      Interactivity (48)
      Web Design (37)

    New

    Hot