Image Loop Fade in/out

Posted on 2007-11-26
Medium Priority
Last Modified: 2012-06-27
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?

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
 image_mc0.loadMovie(image, this)
 fadeMovieClip(clip, 100, 0)
 if(ImageNo+1 < numImages) {
 intervalId = setInterval(this, "rotateImages", duration, myImages[ImageNo]);
if(intervalId != null) {
intervalId = setInterval(this, "rotateImages", duration, myImages[ImageNo]);

Open in new window

Question by:harris9999
1 Comment
LVL 34

Accepted Solution

Aneesh Chopra earned 2000 total points
ID: 20356317
I have a ready version which loads images externally one after another.
it also has fadein-fadeout effect as transition from one image to another,
best part is, "images" and "stay time of image to display" is configurable using an external .inf file

you can download the complete version with sample images, .inf & source file at follwoing URL:

Aneesh Chopra

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question