Solved

seamless flash loop

Posted on 2009-04-08
1
513 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flash media server 1 326
Youtube video error 30 742
File conversion question 5 84
Actionscript in Flash 3 47
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. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

920 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

13 Experts available now in Live!

Get 1:1 Help Now