HELP me with my action script!

I need help what my photo gallery…here is the action script so far…


this.pathToPics = “http://www.members.cox.net/twistedkyle/pics/”;
this.pArray = [“1.JPEG”, “2.JPEG”, “3.JPEG”, “4.JPEG”, “5.JPEG”, “6.JPEG”];
this.fadeSpeed = 20;
this.pIndex = 1;
loadMovie(this.pathToPics+this.pArray[+1], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
// ------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
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;
}
};
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);


the first picture will show but it will not fade out and go to the next picture!! plzzz help me…reply here or send me an e-mail at [email protected]
thanks

maybe where you have this…

this.onEnterFrame = fadeOut;

put:

this.onEnterFrame = fadeOut();

and also do that where you have fadeIn…put the parenthesis after the name of the function.

Its not the fading the other photos wont load. photo 1.JPEG will load but the second photo (2.JPEG) will NOT load

jubb, no brackets in that case. brackets make the function execute, and we just want to point to it, not execute it.

you are pressing the arrow keys to change the pics right?

change this:


// specify the movieclip to load images into
var p = _root.photo;
// ------------------------------------------

to this:


var p = this.createEmptyMovieClip("photo",0);

and remove any clips that you’ve created by hand that may interfere.

This still dosent work this is my action script so far…

this.pathToPics = "http://www.members.cox.net/twistedkyle/pics/";
this.pArray = ["1.JPEG", "2.JPEG", "3.JPEG", "4.JPEG", "5.JPEG", "6.JPEG"];
this.fadeSpeed = 20;
this.pIndex = 1;
loadMovie(this.pathToPics+this.pArray[1], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
var p = this.createEmptyMovieClip("photo",0);
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
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;
}
};
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);