# Caption in a image gallery?

**URL:** https://forum.kirupa.com/t/caption-in-a-image-gallery/278215
**Category:** Uncategorized
**Created:** [December 24, 2008, 5:39am UTC](https://forum.kirupa.com/t/caption-in-a-image-gallery/278215 "2008-12-24T05:39:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Lagaelle](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lagaelle](https://forum.kirupa.com/u/Lagaelle)
#### Post date: [December 24, 2008, 5:39am UTC](https://forum.kirupa.com/t/caption-in-a-image-gallery/278215/1 "2008-12-24T05:39:35Z")

</div>

Hi!  
I have made an image gallery using a tutorial by blue chi ([http://www.oman3d.com/tutorials/flash/imagegallery/](http://www.oman3d.com/tutorials/flash/imagegallery/)). It is basically constituated of thumbs that once clicked let a large image appear. I now want to add captions to these large images, on a rollover. I tried applying the tutorial “Hover Captions” to my movie, without success.  
Being relatively new to all that language, I am not sure it is appliable, and mostly where I should put it, i.e, should i include it to my main timeline or to each image (which are movie clips), on an other layer and so on.  
Here is the code I have for now

```auto
this.createEmptyMovieClip("container",1);

import mx.transitions.Tween;
import mx.transitions.easing.*;

var imagesNumber:Number = 9;
var scrolling:Boolean = true;

for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
myThumb_mc = container["thumb"+i+"_mc"];
myThumb_mc._x = (i-1)*(myThumb_mc._width+4);
myThumb_mc._y = (Stage.height-myThumb_mc._height)/2
myThumb_mc._alpha=50;
myThumb_mc.largerImage = i;
myThumb_mc.onRollOver = function(){
this._alpha=100;
}
myThumb_mc.onRollOut = function(){
this._alpha=50;
}
myThumb_mc.onRelease = function(){
    this._alpha=50;
for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = false;
}
    scrolling = false;
_root.attachMovie("image"+this.largerImage,"large_mc",2);
large_mc._x = (Stage.width - large_mc._width)/2;
large_mc._y = (Stage.height - large_mc._height)/2;

new Tween(large_mc,"_alpha",Strong.easeOut,0,100,0.5,true);
new Tween(container,"_alpha",Strong.easeOut,100,50,0.5,true);
large_mc.onRelease = function(){
    scrolling = true;
    var myFadeOut = new Tween (large_mc,"_alpha",Strong.easeOut, 100,0,0.5,true);
    new Tween(container,"_alpha",Strong.easeOut,100,50,0.5,true);
myFadeOut.onMotionFinished=function(){
    for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = true;
}
large_mc.removeMovieClip();
}
};
};
}

container.onEnterFrame = function() {
    if (scrolling){
this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*7;
if (this._x>0) {
this._x = 0;
}
if (-this._x>(this._width-Stage.width)) {
this._x = -(this._width-Stage.width);
}
}
};

```

Do you have any cues on that matter?  
Thank you very much for all your help and hard work!  
Lagaelle
