harris9999
asked on
Image Loop Fade in/out
I'm trying to create a loop which loads images. The Images fade in/out and stay on the screen for a period of time - 3 seconds.
I had the fade and interval working on there own, but having trouble pulling it together.
Code should be attached to this message
There is problems inside the rotateImages function.
I can't get the proper movieclip name passed to the fadeMovieClip function.
There may also be a problem with depths, should I just keep loading clips at the next highest depth?
I had the fade and interval working on there own, but having trouble pulling it together.
Code should be attached to this message
There is problems inside the rotateImages function.
I can't get the proper movieclip name passed to the fadeMovieClip function.
There may also be a problem with depths, should I just keep loading clips at the next highest depth?
import mx.transitions.Tween;
var myImages:Array = ["images/comm1.jpg", "images/comm2.jpg", "images/comm3.jpg"];
var ImageNo:Number = 0
var numImages:Number = myImages.length
//function to fade images
function fadeMovieClip(myMovieClip:MovieClip, startAt:Number, endAt:Number):Void {
trace("Inside Fade Function: Clipname=" + MyMovieClip)
var myTween:Tween = new Tween(myMovieClip, "_alpha", mx.transitions.easing.None.easeNone, startAt, endAt, 3, true);
}
//fadeMovieClip(image_mc1, 100, 0)
var intervalId:Number;
var duration:Number = 3000;
//var clip:MovieClip;
function rotateImages(image:String) {
this.createEmptyMovieClip("image_mc" + ImageNo, this.getNextHighestDepth());
clip="image_mc" + ImageNo
clip._x=20
image_mc0.loadMovie(image, this)
trace(clip)
fadeMovieClip(clip, 100, 0)
clearInterval(intervalId);
if(ImageNo+1 < numImages) {
ImageNo++;
intervalId = setInterval(this, "rotateImages", duration, myImages[ImageNo]);
}
}
if(intervalId != null) {
clearInterval(intervalId);
}
intervalId = setInterval(this, "rotateImages", duration, myImages[ImageNo]);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.