Forum Moderators: open

Message Too Old, No Replies

Urgent help needed!

Doubt regarding loop...

         

rajeshsivapalan

7:51 am on Dec 14, 2004 (gmt 0)

10+ Year Member


Hi All,

Seasons greetings...

I am facing a problem in flash animation and giving action script.

if i make a movie of 70 frames of simple animation...say for example a ball moving from one place to another. I give different kind of animation from 25 to 45 frames. I give gotoAndPlay(25); .....I want this process to continue only 2 times and then movie to move ahead from 46 frame..

How to do that?

please help!

__________________
regards
Rajesh from India.
Web designer

benihana

9:14 am on Dec 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you could use something along the lines of :

### in frame 25:

//initialise variable to count how many times youve been round

i=0;

### in frame 45:

//increment i

i++;

//check to see if i equals 2, and act accordingly

if (i==2) {
gotoAndPlay(46);
}else {
gotoAndPlay(25);
}

good luck!

n.b. i havent done any actionscript for a while, so you may need to check the exact syntax, but you get the idea.

rajeshsivapalan

10:22 am on Dec 14, 2004 (gmt 0)

10+ Year Member



Got Solution!

In frame #25

i=0;

In frame #45

repeats = repeats+1;
if (repeats <= 2)
{
gotoAndPlay(25);
}