# PhotoGallery: Last bit, I'm stuck!

**URL:** https://forum.kirupa.com/t/photogallery-last-bit-im-stuck/222997
**Category:** flash
**Created:** [April 18, 2007, 5:04pm UTC](https://forum.kirupa.com/t/photogallery-last-bit-im-stuck/222997 "2007-04-18T17:04:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![joehann](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@joehann](https://forum.kirupa.com/u/joehann)
#### Post date: [April 18, 2007, 5:04pm UTC](https://forum.kirupa.com/t/photogallery-last-bit-im-stuck/222997/1 "2007-04-18T17:04:38Z")

</div>

hey fellow AS-Gurus,  
Here I am stuck with yet another mind boggling actionscript problem.

ok, heres the scenario:

I wanna create a photogallery using the following script, essentially what i should get is

5 rows by 5 columns of thumbnails ,  
each thumbmnail has a rollOver function that will show the bigger version of the thumbnail while the rollOver is activated.

Below is the script:

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

var previewWidth:Number = 60;  
var previewHeight:Number = 38;  
var space:Number = 10;  
var columns:Number = 5;  
for (var i=0; i\<25; i++) {  
var x:Number = (i%columns)_(previewWidth+space);  
var y:Number = Math.floor(i/columns)_(previewHeight+space)  
this.attachMovie(“thumb”,“thumb”+i,i,{\_x:x, \_y:y});

//////////// loading pictures into the attachmovie ///////////////////  
this[“thumb”+i].createEmptyMovieClip(“container”, 0);  
this[“thumb”+i].container.loadMovie(“0”+i + “.jpg”);

// scaling the thumbnails.  
this[“thumb”+i].\_xscale = 10;  
this[“thumb”+i].\_yscale =10;

// creating the rollover effect  
this[“thumb”+i].onRollOver = function(){  
new Tween(happy, “\_alpha”, Strong.easeOut, 0, 100, 1, true);  
happy.createEmptyMovieClip(“container2”, 0);  
happy.container2.loadMovie(“0”+ i + “.jpg”);

}  
}

function traceName():Void {  
trace(this.\_name);  
}

Unfortunately, the last bit where the rollover should show the respective thumbnail image in the bigger version doesnt work.

Can someone pls help ???

Thanx a billion !

- Joehann
