I believe this is a target or level issue…but
I am trying to load jpegs into a gallery. The first jpeg will load, but the buttons to load new images do not work on the integrated site and if I use my keyboard arrow keys, I can see the first image begin to fade but then it stops and won’t load the next image. The swf works fine by itself but encounters these problems once integrated.
You can view the photo gallery at www.svengali-fx.com click on the third image on the screen (called Matte Paintings) and you will be taken to the swf page titled matte.swf. You can also see that the page works without the rest of the swf by trying it out as www.svengali-fx.com/matte.swf
Here is the code I am using and I have to think it is a target prob…but I am stumped.
Thanks for any help!
code:
this.pathToPics = “animation/”;
this.pArray = [“walley.jpg”, “scorp.jpg”,“dances.jpg”,“mystery.jpg”];
this.fadeSpeed = 20;
this.pIndex = 0;
loadMovie(this.pathToPics+this.pArray[0], _root.createEmptyMovieClip(photo, 1));
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 = _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);