all groups > flash actionscript > january 2006 >
You're in the

flash actionscript

group:

slideshow


slideshow p8ntblr
1/31/2006 7:29:12 PM
flash actionscript:
I'm trying to make simple slideshow that will have a pics fade out as you click
the next or back button. Everything works if I just go straight next or
straight back button. The problem is when I transition (ie I click next a few
times then click back). I have to click on the transition buttonbutton (in
this example back) twice. Cuz I haven't changed the NIndex properly. I'm not
sure how to fix this. Here's the code:

var currentPic: Array = new Array(mc1,mc2,mc3);
var nIndex:Number = 0;
var nInterval:Number;


mcForward.onRelease = function ():Void {
nInterval = setInterval(fadePic, 50, currentPic,true);
};

mcBackward.onRelease = function ():Void {
nInterval = setInterval(fadePic, 50, currentPic,false);
};

function fadePic (mcPic:MovieClip, forward:Boolean):Void {
if (forward == true) {
mcPic._alpha -= 10;
if (mcPic._alpha <= 0) {
clearInterval(nInterval);
nIndex++;
}
}

else {
mcPic._alpha += 10;
if (mcPic._alpha >= 100) {
nIndex--;
clearInterval(nInterval);


Re: slideshow p8ntblr
2/1/2006 2:57:21 AM
Re: slideshow Ljsunrainy NO[at]SPAM gmail.com
2/4/2006 11:34:13 PM
Hi, p8ntblr,

Here is an exmple for creating such a photo slide show with flash
animation: http://www.photo2vcd.com/resource/create-photo-gallery.html

Regards
AddThis Social Bookmark Button