|
-
Simple Slideshow Help
I'm currently creating a simple slideshow for a client. Nothing more than a few photos (inside of movie clip instances) and two buttons. A right arrow to go to the next slide and a left arrow to go to the previous slide. When the right arrow is clicked the current slide on stage should fade out using an alpha tween and the next slide should fade in. I decided to use a for while loop to create an array and condense code but it's pretty clear I don't have it just right. Here's what I currently have and maybe someone can just steer me in the right direction. I know I'm pretty close.
import fl.transitions.Tween;
import fl.transitions.easing.*;
var inTween:Tween;
var outTween:Tween;
slide1_mc.visible=true;
slide2_mc.visible=false;
slide3_mc.visible=false;
slide4_mc.visible=false;
// Add events on the fly, cuts code =)
for(var i:int=0; i < 4; i++)
{
var mcName:String = "slide" + (i + 1) + "_mc";
}
rightArrow_btn.addEventListener(MouseEvent.MOUSE_D OWN, slide_right);
leftArrow_btn.addEventListener(MouseEvent.MOUSE_DO WN, slide_left);
function slide_right(event:MouseEvent):void {
outTween = new Tween([mcName],"alpha",None.easeNone,1,0,1,true);
inTween = new Tween([mcName],"alpha",None.easeNone,0,1,1,true);
}
function slide_left(event:MouseEvent):void {
outTween = new Tween([mcName],"alpha",None.easeNone,1,0,1,true);
inTween = new Tween([mcName],"alpha",None.easeNone,0,1,1,true);
}
Adam Bell
[email protected]
--
Over 90% of all websites
suck......
Join the minority.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|