Flash Tooltips – Tutorial and Example Download

by Hiroshi on October 21, 2008

in Actionscript, Adobe Flash, Utilities

Tooltips or titles in flash movies are helpful for extra information about any page or section of movie. You might give user some information about the link before he is going to click at that. For this regard tool tips are very helpful.

Single Tooltip (Title) on Movie Clip or Button

Create a movie clip named as js or whatever you like, with first frame stopped and on second frame in it tooltip movie with left bottom center. Create a button in main time line or where you want it and apply following actionscript.

on (rollOver) {
tellTarget ("/js") {
gotoAndStop(2);
}
startDrag("js", true);
}
on (release, rollOut) {
tellTarget ("/js") {
gotoAndStop(1);
}
}

Download Tooltip Single Files

Multiple Tooltips (Titles) For More Than One Movie Clips or Buttons

Create a movie clip named as m with first frame containing stop action and other frames with tool tips images or texts and assign every frame a label. *Again center of this tool tip movie must be left bottom*. Create buttons at main time line (Here I take example of four buttons). Add action script. You can use slash (relative path) or target (absolute path) for indicating tool tip movies in actionscript.

For Button 1
on (rollOver) {
tellTarget ("/m") {
gotoAndStop("home");
}
}
on (rollOut) {
tellTarget ("/m") {
gotoAndStop("of");
}
}
For Button 2
on (rollOver) {
tellTarget ("/m") {
gotoAndStop("intro");
}
}
on (release, rollOut) {
tellTarget ("/m") {
gotoAndStop("off");
}
}

m is movieclip here and home and intro are frame labels in m movieclip containing texts for tooltip to appear.
Here off is blank key frame in tooltip movie. When mouse is not over any button or movie or it rolls out from any movie or button movieclip m will point to off labelled keyframe which does not have any test or tooltip to display.

Add this script in the m movieclip (tooltips) first frame.

startDrag(getProperty ( _x, _y ), true);
stop();

Download Tooltip Multiple Files

Related Posts

Previous post:

Next post: