jump to navigation

Easy Made Tooltip with AC3 October 15, 2010

Posted by Tournas Dimitrios in Actionscript.

A tooltip is a brief, descriptive message that appears when you hover the mouse over an object. It is very useful and simple to create. I will create a basic one for you in Actionscript 3.0 with an “alpha” effect when you point the mouse over a movieclip.
1. Open Flash and create a new AS 3 file. (200×150)

2. Draw a rectangle(this will be our target object) and convert it to a movieclip. Give it an instance name of “mc”

3. Now we’ll create the tooltip movieclip. Draw a stroke and create a dynamic TextField. Name it “txt”. Select both and covert them to a movieclip “Tooltip”. For this one check the “Export for Actionscript” box. Delete the movieclip you just created from the stage because we’ll build an instance of it from Actionscript.

4. On the first frame of the stage, open up Actions tab and write this code:

import fl.transitions.easing.*;
import fl.transitions.*;

mc.addEventListener("mouseOver", mouseRollOver);
mc.addEventListener("mouseOut", mouseRollOut);
mc.addEventListener("mouseMove", mouseMove1);

var tooltip:Tooltip = new Tooltip();
tooltip.txt.text = "This is a tooltip";
tooltip.x = stage.mouseX;
tooltip.y = stage.mouseY - mc.height;

function mouseRollOver(e:MouseEvent):void {
    var myTween:Tween = new Tween(tooltip, "alpha", Regular.easeIn, 0, 1, 0.5, true);


function mouseRollOut(e:MouseEvent):void {

function mouseMove1(e:MouseEvent):void {
    tooltip.x = stage.mouseX;
    tooltip.y = stage.mouseY - mc.height;


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s