les muestro el script actual:
en el primer frame tengo esto-->
Código:
en el boton "proxima"this.pathToPics = "animation/"; this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg"]; this.fadeSpeed = 20; this.pIndex = 0; loadMovie(this.pathToPics+this.pArray[0], _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 = _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);
Código:
en el boton"anterior:on (release) { _root.changePhoto(1); }
Código:
on (release) { _root.changePhoto(-1); }