• home
  • forum
  • my
  • kt
  • download
  • Flash Image Animation

    Author: 2007-06-13 11:03:13 From:

    This tutorial will show you how to add tool tips to any flash project.Tool tips are extremely useful for informing users of what is interactive in a flash project. The method I use to employ tool tips is very simple and easy to use. It will be done with a single movieclip for all toop tips to keep file size down.

    Open a new Flash movie.The first thing to do is to create our tool tip holder. Create a movieclip and name it "toolTip_MC".The movieclip should only be located in your library. Either when creating the movieclip, or by selecting the clip in the library, set the linkage for the clip to export for actionscript in the first frame with an id of "toolTip_MC".Select the movieclip so that you are inside the movieclip.Create a dynamic textfield with an instance name of "message". Now we are done authoring the necessary object for the toop tip. Now we need to create the actionscript to use the tool tip movieclip. On the first frame of the main timeline, paste this custom tool tip function


    /*
    Tool Tip Function
    by
    T. Norman
    http://ntdesigns.net
    */
    //Main function
    function toolTip(tagTarget, myMessage) {
    //Handle the rollOver event
    tagTarget.onRollOver = function() {
    //disable hand cursor
    tagTarget.useHandCursor = false;
    //create a movieclip to hold the tooltip MC
    h = _root.createEmptyMovieClip("h", 10);
    //position the tooltip dynamically to the mouse position
    h._y = _root._ymouse-30;
    h._x = _root._xmouse;
    //attach the tooltip MC from the library
    h.attachMovie("toolTip_MC", "toolTip_MC", 10);
    //format the message textfield
    h.toolTip_MC.message.autoSize=true;
    h.toolTip_MC.message.border=true;
    h.toolTip_MC.message.backgroundColor=0x00FFCC;
    //control the message with the myMessage parameter of the function
    h.toolTip_MC.message.text = myMessage;
    //position the tooltip on mouse move
    h.onMouseMove = function() {
    h._y = _root._ymouse-30;
    h._x = _root._xmouse;
    }
    //trace("I was hit");
    }
    //remove the tool tip
    tagTarget.onRollOut = function() {
    removeMovieClip(h);
    }
    }
    //Usage
    _root.toolTip(_root.square, "This is a movieclip.");
    _root.toolTip(_root.myButton, "This is a button.");



    When your done, it should work something like this demo.



    You can use this technique to add interactivity to any project.Tool tips help users identify where to go and what to do.

    Download Source File

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (25)
      Tricks (6)
      Games (66)
      Utilities (19)
      Getting Started (71)
      Video (10)
      Interactivity (21)
      Web Design (22)

    New

    Hot