Solved

seamless flash loop

Posted on 2009-04-08
1
512 Views
Last Modified: 2013-11-11
Hi,
i'm trying to created a seamless loop of fading images using actionscript. With the AS i'm using it fades out the last image then fades in the first image again so there is a gap between the last and the first image.
I'd like the last image to fade into the first image seamlessly without a gap.
I'm using tweenlite but would take suggestions of other options
Below is my code:
import gs.TweenLite;
 
 

		function startShow():Void {		

		

		image1._alpha = 0; // start faded down

		TweenLite.to(image1, 1, {_alpha:100});

		TweenLite.to(image1, 1, {_alpha:0, delay:3, overwrite:false});

		

		image2._alpha = 0; // start faded down

		TweenLite.to(image2, 1, {_alpha:100, delay:3, overwrite:false});

		TweenLite.to(image2, 1, {_alpha:0, delay:6, overwrite:false});

		

		image3._alpha = 0; // start faded down

		TweenLite.to(image3, 1, {_alpha:100, delay:6, overwrite:false });

		TweenLite.to(image3, 1, {_alpha:0, delay:9, overwrite:false});
 

		

		image4._alpha = 0; // start faded down

		TweenLite.to(image4, 1, {_alpha:100, delay:9, overwrite:false});

		TweenLite.to(image4, 1, {_alpha:0, delay:12, overwrite:false});
 

		image5._alpha = 0; // start faded down

		TweenLite.to(image5, 1, {_alpha:100, delay:12, overwrite:false});		

		TweenLite.to(image5, 1, {_alpha:0, delay:15, overwrite:false, onComplete:startShow, onCompleteScope:this});

   }
 

startShow();

Open in new window

0
Comment
Question by:George-TCC
1 Comment
 
LVL 8

Accepted Solution

by:
wal_toor earned 500 total points
ID: 24113843
Hellow,

I think it has to do with the delay settings. The fading takes 1 second. After this you start fading in the next one. I think you have to start fading in 1 second earlier.

Try this.

greetz,
walter
import gs.TweenLite;

 

 

                function startShow():Void {             

                

                image1._alpha = 0; // start faded down

                TweenLite.to(image1, 1, {_alpha:100});

                TweenLite.to(image1, 1, {_alpha:0, delay:3, overwrite:false});

                

                image2._alpha = 0; // start faded down

                TweenLite.to(image2, 1, {_alpha:100, delay:2, overwrite:false});

                TweenLite.to(image2, 1, {_alpha:0, delay:5, overwrite:false});

                

                image3._alpha = 0; // start faded down

                TweenLite.to(image3, 1, {_alpha:100, delay:4, overwrite:false });

                TweenLite.to(image3, 1, {_alpha:0, delay:7, overwrite:false});

 

                

                image4._alpha = 0; // start faded down

                TweenLite.to(image4, 1, {_alpha:100, delay:6, overwrite:false});

                TweenLite.to(image4, 1, {_alpha:0, delay:9, overwrite:false});

 

                image5._alpha = 0; // start faded down

                TweenLite.to(image5, 1, {_alpha:100, delay:8, overwrite:false});               

                TweenLite.to(image5, 1, {_alpha:0, delay:11, overwrite:false, onComplete:startShow, onCompleteScope:this});

   }

 

startShow();

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now