# Dynamic gallery

**URL:** <https://forum.kirupa.com/t/dynamic-gallery/26782>\
**Category:** web dev\
**Created:** [July 26, 2003, 8:17am UTC](https://forum.kirupa.com/t/dynamic-gallery/26782 "2003-07-26T08:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sceleratus](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sceleratus](https://forum.kirupa.com/u/Sceleratus)\
**Post date:** [July 26, 2003, 8:17am UTC](https://forum.kirupa.com/t/dynamic-gallery/26782/1 "2003-07-26T08:17:06Z")

</div>

Hi, Im using this code for a dynamic photogallery.  
This code is on the Mc:

onClipEvent (enterFrame) {  
//+++++++++++++++++++++++++++++++++++++++++++++++  
// code to fade pictures in and out  
//+++++++++++++++++++++++++++++++++++++++++++++++

```
if (this._alpha&gt;=0 && _root.view == 1) {
	this._alpha -= 5;
}
if (this._alpha&lt;=0) {
	_root.view = 0;
	loadMovie("image"+_root.pic_num+".jpg", "_root.photos");
	size = this.getBytesTotal();
	loaded = this.getBytesLoaded();
	trace(this.getBytesLoaded());
	
	if (size != loaded) {
		_root.message = "loading image";
	} else {
		_root.message = " ";
	}
}
if (_root.view == 0) {
	this._alpha += 5;
}
if (this._alpha&gt;=100) {
	_root.view = 2;
	this._alpha;
}

//+++++++++++++++++++++++++++++++++++++++++++++++
// code to make next and previous buttons behave!
//+++++++++++++++++++++++++++++++++++++++++++++++

_root.totalpictures = 9;
if (_root.pic_num&lt;=0) {
	_root.previous.enabled = false;
} else {
	_root.previous.enabled = true;
}
if (_root.pic_num == _root.totalpictures) {
	_root.next.enabled = false;
} else {
	_root.next.enabled = true;
}

```

}

And on the buttons I have this code:

on (release) {  
\_root.view = 1;  
\_root.pic\_num -= 1;  
}

* * *

on (release) {  
\_root.view = 1;  
\_root.pic\_num += 1;  
}

How would I change this script to have button with numbers on instead.  
If you click button3 picture 3 loads, and if you click button 5 picture 5  
loads.
