Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,254 Programmers. There are 2,104 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Making it Loop

 
Reply to this topicStart new topic

Making it Loop, SlideSHow that once finish's it then starts at the begining

bmcc81
post 7 May, 2008 - 01:08 PM
Post #1


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 70



Hi,

I'm trying to get this thing to loop or to start back at the beginning.

CODE


var i:Number = 1;

function DoRandom() {
var target_x = home_x - content_mc["section_"+i]._x;
content_mc.slideTo( target_x, "0", 2 );
i++;

if(i==6) var target_x = home_x-content_mc.section_0._x;
    content_mc.slideTo(target_x,"0",2);
    if(i==1) var alphaT:Tween = new Tween(b_0, "_alpha", Regular.easeOut, 50, 70, 1, true);
    if(i==2) var alphaT:Tween = new Tween(b_0, "_alpha", Regular.easeOut, 50, 50, 1, true);
    if(i==2) var alphaT:Tween = new Tween(b_1, "_alpha", Regular.easeOut, 50, 70, 1, true);
    if(i==3) var alphaT:Tween = new Tween(b_1, "_alpha", Regular.easeOut, 50, 50, 1, true);
    if(i==3) var alphaT:Tween = new Tween(b_2, "_alpha", Regular.easeOut, 50, 70, 1, true);
    if(i==4) var alphaT:Tween = new Tween(b_3, "_alpha", Regular.easeOut, 50, 70, 1, true);
    if(i==4) var alphaT:Tween = new Tween(b_2, "_alpha", Regular.easeOut, 50, 50, 1, true);
    if(i==5) var alphaT:Tween = new Tween(b_4, "_alpha", Regular.easeOut, 50, 70, 1, true);
    if(i==5) var alphaT:Tween = new Tween(b_3, "_alpha", Regular.easeOut, 50, 50, 1, true);
    if(i==6) var alphaT:Tween = new Tween(b_4, "_alpha", Regular.easeOut, 50, 50, 1, true);
    if(i==6) var alphaT:Tween = new Tween(b_0, "_alpha", Regular.easeOut, 50, 70, 1, true);
}  

var intervalID = setInterval(DoRandom, 4000);



Can anyone tell me how to make it loop?

Thanks,
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


bmcc81
post 7 May, 2008 - 02:04 PM
Post #2


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 70

Or maybe saying once done the restart?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

bmcc81
post 8 May, 2008 - 06:55 AM
Post #3


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 70

I case it looks a little scary I took out some irrelevant code.


I just want to make this loop or start over.


CODE
var i:Number = 1;

function DoRandom() {
var target_x = home_x - content_mc["section_"+i]._x;
content_mc.slideTo( target_x, "0", 2 );
i++;

if(i==6) var target_x = home_x-content_mc.section_0._x;
    content_mc.slideTo(target_x,"0",2);
}  

var intervalID = setInterval(DoRandom, 4000);



Thanks in advance,

This post has been edited by bmcc81: 8 May, 2008 - 06:57 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

bmcc81
post 8 May, 2008 - 08:08 AM
Post #4


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 70

So I put a trace in the Function DoRandom();

It goes
2
3
4
5
6
7

I figure that one it hits 7 the to set back (Var i = 0)

Is that possible? or how would I do that?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:30AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month