# Hover captions in a movie clip?

**URL:** <https://forum.kirupa.com/t/hover-captions-in-a-movie-clip/226825>\
**Category:** flash\
**Created:** [May 24, 2007, 10:44am UTC](https://forum.kirupa.com/t/hover-captions-in-a-movie-clip/226825 "2007-05-24T10:44:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clinton](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@Clinton](https://forum.kirupa.com/u/Clinton)\
**Post date:** [May 24, 2007, 10:44am UTC](https://forum.kirupa.com/t/hover-captions-in-a-movie-clip/226825/1 "2007-05-24T10:44:17Z")

</div>

Hi all i was following a tutorial on the forum about hover captions and it works completely fine when its on the main stage, however when i try to place it in a movie clip it keeps breaking…does anyone know how to fix this?

The code i used is below. I havent really moded much appart from the instance names… I tried adding a \_root in front of the instance names but that didnt work iether. Any help would be great!

[SIZE=4] **code:** [/SIZE]

G\_gal\_1.onRollOver = function() {

captionFN(true, “Gallery 1”, this);  
G\_gal\_1.onRollOut = function() {

captionFN(false);

};

};  
G\_gal\_2.onRollOver = function() {

captionFN(true, “Gallery 2”, this);  
G\_gal\_2.onRollOut = function() {

captionFN(false);

};

};  
G\_gal\_3.onRollOver = function() {

captionFN(true, “Gallery 3”, this);  
G\_gal\_3.onRollOut = function() {

captionFN(false);

};

};  
G\_gal\_4.onRollOver = function() {

captionFN(true, “Gallery 4”, this);  
G\_gal\_4.onRollOut = function() {

captionFN(false);

};

};  
G\_gal\_5.onRollOver = function() {

captionFN(true, “Gallery 5”, this);  
G\_gal\_5.onRollOut = function() {

captionFN(false);

};

};  
G\_gal\_6.onRollOver = function() {

captionFN(true, “Gallery 6”, this);  
G\_gal\_6.onRollOut = function() {

captionFN(false);

};

};  
captionFN = function (showCaption, captionText, G\_gal\_Name) {

if (showCaption) {

\_root.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());  
cap.desc.text = captionText;  
cap.\_width = 7\*cap.desc.text.length;  
cap.\_alpha = 75;  
//  
if ((G\_gal\_Name.\_width+G\_gal\_Name.\_x+cap.\_width)\>Stage.width) {

xo = -2-cap.\_width;  
yo = -17;

} else {

xo = 2;  
yo = -17;

}  
hoverCaption.onEnterFrame = function() {

cap.\_x = \_root.\_xmouse+xo;  
cap.\_y = \_root.\_ymouse+yo;  
cap.\_visible = true;

};

} else {

delete hoverCaption.onEnterFrame;  
cap.\_visible = false;

}

};
