Solved

Image Loop Fade in/out

Posted on 2007-11-26
1
3,000 Views
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
 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]);

Open in new window

0
Comment
Question by:harris9999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 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:
http://www.4shared.com/file/2088409/37665d58/slideshow_sequencially.html

-------------------
Aneesh Chopra
-------------------
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 492
Stock Videos 17 346
High Internet Explorer CPU on Flash site in Citrix 2 870
Advertising design for my own Purpose 5 92
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

749 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