# Multiple Photo galleries?

**URL:** <https://forum.kirupa.com/t/multiple-photo-galleries/20018>\
**Category:** flash\
**Created:** [May 4, 2003, 2:48am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018 "2003-05-04T02:48:07Z")\
**Posts on this page:** 7\
**Page:** 5

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 3:37am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/81 "2003-05-19T03:37:28Z")

</div>

Hey super **kax** :), worked out the alpha problem this is the final code, all i need to do now is add a preloader percent and bar.

```auto

_global.subgallery=0, _global.index=0,
gallery = [whatever];
gallerytext = [whatever];
galleryurl = [whatever];
this.fadeSpeed = 20;
delay = 3000;

for (i=1; i<=4; i++) {
        test["sub"+i].i = i-1;
        test["sub"+i].onRelease = function() {
                _global.subgallery = this.i;
                _global.index = 0;
                this._parent._parent.pic.loadMovie(gallery[subgallery][index]);
                this._parent._parent.currentImage.text = gallerytext[subgallery][index];
				this._parent._parent.onEnterFrame = fadeOut;}
};
		
function fadeOut() {
        if (_root.photo._alpha>fadeSpeed) {
                _root.photo._alpha -= fadeSpeed;
        } else {
                delete this.onEnterFrame;
                this.loadPhoto();
        }

};

function loadPhoto() {
	// specify the movieclip to load images into
	var p = this.pic;
	//------------------------------------------
	p._alpha = 0;
	p.loadMovie(gallery[subgallery][index]);
	this.onEnterFrame = loadMeter;
};
function loadMeter() {
	var i, l, t;
	l = this.pic.getBytesLoaded();
	t = this.pic.getBytesTotal();
	if (t>0 && t == l) {
		this.onEnterFrame = fadeIn;
	} else {
		trace(l/t);
	}
};
function fadeIn() {
	if (this.pic._alpha<100-this.fadeSpeed) {
		this.pic._alpha += this.fadeSpeed;
	} else {
		this.pic._alpha = 100;
		this.onEnterFrame = null;
	}
};

prevPic.onRelease = function() {
	_global.index>0 ? _global.index-- : _global.index=gallery[subgallery].length-1;
	this._parent.pic.loadMovie(gallery[subgallery][index]);
	this._parent.currentImage.text = gallerytext[subgallery][index];
	this._parent.onEnterFrame = fadeOut;
	myInterval = setInterval(changePhoto, delay);

};
nextPic.onRelease = function() {
	_global.index<gallery[subgallery].length-1 ? _global.index++ : _global.index=0;
	this._parent.pic.loadMovie(gallery[subgallery][index]);
	this._parent.currentImage.text = gallerytext[subgallery][index];
	this._parent.onEnterFrame = fadeOut;
	myInterval = setInterval(changePhoto, delay);

};
launch.onRelease = function() {
        getURL(galleryurl[subgallery][index], "_blank");
};

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:09am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/82 "2003-05-19T04:09:44Z")

</div>

i guess i’d try something like this:

```auto
function loadPhoto() {
	var p = this.pic;
	p._alpha = 0;
	p.loadMovie(gallery[subgallery][index]);
	**barMovieClip._visible = percentTextField._visible = 1;**
	this.onEnterFrame = loadMeter;
};
function loadMeter() {
	var i, l, t, p;
	l = this.pic.getBytesLoaded();
	t = this.pic.getBytesTotal();
	**p = (l/t)*100;
	barMovieClip._width = p;
	percentTextField.text = p+"%";**
	if (t>0 && t == l) {
		**barMovieClip._visible = percentTextField._visible = 0;**
		this.onEnterFrame = fadeIn;
	} else {
		trace(l/t);
	}
};

```

=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:15am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/83 "2003-05-19T04:15:28Z")

</div>

Yeah i was working on the same theory, lol , your code seem to be more complete than what i had. 🙂

thanks dude.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:23am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/84 "2003-05-19T04:23:08Z")

</div>

anyway i can make it so that the image dont cache (for testing purposes) so i dont have to delete temp always.?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:35am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/85 "2003-05-19T04:35:14Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=14268&postid=112688#post112688](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=14268&postid=112688#post112688) 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:36am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/86 "2003-05-19T04:36:37Z")

</div>

thanks :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 4:38am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/87 "2003-05-19T04:38:45Z")

</div>

de nada. 😛

[Previous page](https://forum.kirupa.com/t/multiple-photo-galleries/20018.md?page=4)
