Photo Gallery tutorial help

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!

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

done

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

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

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?

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.

Alright. Thanks anyway!

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…