# Expaning tooltip

**URL:** <https://forum.kirupa.com/t/expaning-tooltip/251330>\
**Category:** Uncategorized\
**Created:** [February 7, 2008, 2:26pm UTC](https://forum.kirupa.com/t/expaning-tooltip/251330 "2008-02-07T14:26:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffGrafix\_nl](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@JeffGrafix\_nl](https://forum.kirupa.com/u/JeffGrafix_nl)\
**Post date:** [February 7, 2008, 2:26pm UTC](https://forum.kirupa.com/t/expaning-tooltip/251330/1 "2008-02-07T14:26:35Z")

</div>

Hi all,

I’ve made a map of Europe with a tooltip on some of the countries. When you hover over lets say Spain, you get a tooltip saying ‘Lets go to Spain!’.

Now my problem is that sometimes the tooltip is to short for the text.  
Is there a way to make my tooltip expand according to the text I want to show?

Actionscript on frame 1:

```auto
function tooltip (string) { 
 xmouse = getProperty("", _xmouse);
 ymouse = getProperty("", _ymouse);
 duplicateMovieClip ("_root.tooltip", "tooltip1", 1);
 tooltip1.tooltip = string;
 setProperty (tooltip1, _x, xmouse);
 setProperty (tooltip1, _y, ymouse);
 startDrag ("_root.tooltip1");
 tooltip1.gotoAndStop(2);
} 
function remove_tooltip () { 
 stopDrag ();
 removeMovieClip ("tooltip1");
}

```

Actionscript on the buttons/countries:

```auto
on (rollOver) { 
 _root.tooltip("Lets go to Spain!");
} 
on (rollOut, dragOut) { 
 _root.remove_tooltip();
}

```
