# Photo Gallery tutorial help

**URL:** https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737
**Category:** flash
**Created:** [March 27, 2003, 10:47pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737 "2003-03-27T22:47:47Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Hakmed](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hakmed](https://forum.kirupa.com/u/Hakmed)
#### Post date: [March 27, 2003, 10:47pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/1 "2003-03-27T22:47:47Z")

</div>

Using MX!

So I’m a bigtime newbee to actionscript… and man… it’s alot tougher than I thought. Anyways, I was going through the photo gallery tutorial and I’m trying to customize it to fit my needs.

I have some thumbnails scrolling across the bottom and each thumbnail is a button w/ the following action:

[AS]  
on (release) {  
\_root.changePhoto(“1.gif”);  
}  
[/AS]

so I’m basically setting the path to the larger size pic in the action of the thumbnail button.

In the main actions layer, I have the following:

[AS]  
this.fadeSpeed = 20;  
this.pathToPics = “pics/”;  
MovieClip.prototype.changePhoto = function (d) {  
this.onEnterFrame = fadeOut(d);  
};  
MovieClip.prototype.fadeOut = function(d) {  
if (this.photo.\_alpha\>this.fadeSpeed) {  
this.photo.\_alpha -= this.fadeSpeed;  
} else {  
this.loadPhoto(d);  
}  
};  
MovieClip.prototype.loadPhoto = function(d) {  
// specify the movieclip to load images into  
var p = \_root.photo;  
//------------------------------------------  
p.\_alpha = 0;  
p.loadMovie(this.pathToPics+d);  
this.onEnterFrame = loadMeter;  
};  
MovieClip.prototype.loadMeter = function() {  
var i, l, t;  
l = this.photo.getBytesLoaded();  
t = this.photo.getBytesTotal();  
if (t\>0 && t == l) {  
this.onEnterFrame = fadeIn;  
} else {  
trace(l/t);  
}  
};  
MovieClip.prototype.fadeIn = function() {  
if (this.photo.\_alpha\<100-this.fadeSpeed) {  
this.photo.\_alpha += this.fadeSpeed;  
} else {  
this.photo.\_alpha = 100;  
this.onEnterFrame = null;  
}  
};  
[/AS]

Now what I’m thinking, is that whenever I click the thumbnail of the pic I wanna view on the “photo” movie clip, the previous pic will fade out and the new pic will fade in. But it doesn’t work!

Any advice will help ALOT! THank you!

---

<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: [March 27, 2003, 10:52pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/2 "2003-03-27T22:52:29Z")

</div>

hey bud, can you put that in the actionscript tags?

---

<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: [March 27, 2003, 11:00pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/3 "2003-03-27T23:00:27Z")

</div>

done

---

<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: [March 27, 2003, 11:04pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/4 "2003-03-27T23:04:32Z")

</div>

Thank you :). Doubt if I can help but I’ll try.

---

<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: [March 27, 2003, 11:10pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/5 "2003-03-27T23:10:24Z")

</div>

Well you dont have any of the array code in there. Do you have that in your flash movie?

---

<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: [March 27, 2003, 11:43pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/6 "2003-03-27T23:43:50Z")

</div>

Actually, I was trying to pass the filename from the thumbnail button action:

[AS]  
on (release) {  
\_root.changePhoto(“1.gif”);  
}  
[/AS]

…instead of using an array index. I thought I had removed the array dependency from the script. Did I leave something in the code in my first post that references an array?

---

<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: [March 28, 2003, 1:18am UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/7 "2003-03-28T01:18:59Z")

</div>

Dont think so, I was just wondering where it went. Anyway, I’m afraid I cant help you, but maybe the author can, or a number of other mods.

---

<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: [March 28, 2003, 6:04pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/8 "2003-03-28T18:04:01Z")

</div>

Alright. Thanks anyway!

---

<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: [March 29, 2003, 1:41pm UTC](https://forum.kirupa.com/t/photo-gallery-tutorial-help/16737/9 "2003-03-29T13:41:13Z")

</div>

Hi, I’m not a super coder, here. But I think you should try with standard .jpg file before assuming the problem is with your code. Flash can’t laod exteral .gifs or progressive .jpegs, I believe…
