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!