# Problem with changing dynamic text

**URL:** <https://forum.kirupa.com/t/problem-with-changing-dynamic-text/174410>\
**Category:** Uncategorized\
**Created:** [January 5, 2006, 2:44pm UTC](https://forum.kirupa.com/t/problem-with-changing-dynamic-text/174410 "2006-01-05T14:44:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [January 5, 2006, 2:44pm UTC](https://forum.kirupa.com/t/problem-with-changing-dynamic-text/174410/1 "2006-01-05T14:44:56Z")

</div>

I have a function which allows a move clip to be attached to a button and will show a hover caption. The text box is dynamic but I am having trouble changing the text for a specific button.

example: when I roll over my contact button, I want the hover caption to say something different then when I roll over my resume button.

here is the actionscript

function hover() {  
// attaches the MC for hovering over the thumbnail  
\_root.attachMovie(“hoverTip”, “hoverTip”, 750, {\_x:\_root.\_xmouse, \_y:\_root.\_ymouse});  
hoverTip.hoverTxt.text = “click here to send email”;  
sp = 5;

onEnterFrame = function () {  
// follow the ■■■■ mouse!  
hoverTip.\_x += (Math.round(Math.round(\_root.\_xmouse)-hoverTip.\_x))/sp;  
hoverTip.\_y += (Math.round(Math.round(\_root.\_ymouse)-hoverTip.\_y))/sp;  
};  
}

function dehover() {  
// gets rid of that ■■■■ mouse thing!  
sp = 5;

onEnterFrame = function () {  
hoverTip.\_x += (Math.round(Math.round(\_root.\_xmouse)-hoverTip.\_x))/sp;  
hoverTip.\_y += (Math.round(Math.round(\_root.\_ymouse)-hoverTip.\_y))/sp;  
hoverTip.prevFrame(); // plays the MC backwards 😉  
if (hoverTip.\_currentframe == 1) {  
// unloads it when it’s reached 1  
hoverTip.unloadMovie();  
}  
};  
}

contact\_btn.onRollOver = function() {  
hover();  
};  
contact\_btn.onRollOut = function() {  
dehover();  
};

I have gotten the dynamic text to change, but like I said above I can get it to change for a specific button.

If anyone can help me out it would be greatly appreciated.
