# Problem attaching a movie from library

**URL:** <https://forum.kirupa.com/t/problem-attaching-a-movie-from-library/224978>\
**Category:** Uncategorized\
**Created:** [May 7, 2007, 7:29pm UTC](https://forum.kirupa.com/t/problem-attaching-a-movie-from-library/224978 "2007-05-07T19:29:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhunt](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mhunt](https://forum.kirupa.com/u/mhunt)\
**Post date:** [May 7, 2007, 7:29pm UTC](https://forum.kirupa.com/t/problem-attaching-a-movie-from-library/224978/1 "2007-05-07T19:29:13Z")

</div>

I modified the code for the hover captions that is on [kirupa.com](http://kirupa.com)  
The reason i had to try and modify it is because i am generating thumbnails from an xml document and when i want to use the hover caption it is creating the hover on the depth of -16745 or something and all of the thumbnails are on levels 1-10 or however many there are  
I can’t seem to figure out how to get the caption to be above the thumbnails.  
here is the code i have so far, hope someone can help. but this code so far doesn’t show the caption image that I have in my library  
argh

```auto

captionFN = function (showCaption, captionText, bName) {
    if (showCaption) {
        //var caption:MovieClip = _root.createEmptyMovieClip("hoverCaption", getNextHighestDepth());
        //trace(this.getDepth());
        this.attachMovie("caption", "cap_mc", this.getNextHighestDepth());
        //cap_mc.caption_txt.text = captionText;
        if ((bName._width+bName._x+cap_mc._width)>Stage.width) {
            xo = -2-cap._width;
            yo = -17;
        } else {
            xo = 2;
            yo = -17;
        }
        cap_mc.onEnterFrame = function() {
            cap_mc._x = _root._xmouse+xo;
            cap_mc._y = _root._ymouse+yo;
            cap_mc._visible = true;
        };
    } else {
        delete hoverCaption.onEnterFrame;
        cap_mc.removeMovieClip();
    }
};

```
