Flashadvisor logo
:: Desktop Shortcut
:: Flash Help
Advices from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend ·

      Add Tutorial |

 

Advertise here








 

Google

Search WWW   
FlashAdvisor.com

 Home > Tutorials  > ActionScript

Flash Image Animation

Author: T.Norman | Email
Website : www.ntdesigns.net


Advertisement

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

| 1 |

Rate This Tutorial :
We hope the information helped you. If you have any questions or comments, please don't hesitate to post them on the Forums section
Submit your Tutorial at Click Here
  

Home | About Us | Contact Us | Feedback | Advertise with us

Best viewed in 800x600 resolution with Internet Explorer.

Site Developed and Hosted by  ethicsolutions.com
All rights reserved with FlashAdvisor

Flash is a registered trademark of Adobe Systems, Inc.

1 user online