Skip to main content
Participant
December 6, 2007
Question

Playing a clip 3x's and then going to URL

  • December 6, 2007
  • 2 replies
  • 392 views
I am a newbie so I apologize in advance. I have created a flash intro and set up a page for it. Originally I had the intro play until "go to main site" was clicked. Then I changed it to add an action in the last frame to "getURL". Now I would like to have the intro play 3 times and then, if not clicked, go to the URL.

I was wondering how to do this, I thought there might be a way to put code in the last frame like n=1, if/then statement using n<3 then play with n=n+1in the end of the "do" loop, if n=3 then "getURL". I could just copy the flash intro movie three times in flash and re-publish but where's the fun in that? Let me know if you have any suggestions... thanks!

This topic has been closed for replies.

2 replies

Inspiring
December 6, 2007
You should probably set the loop point in frame 2, lest you continue to set the counter back to 0.
Inspiring
December 6, 2007
Yep, you are right!
Inspiring
December 6, 2007
I think you are on a right track.

In the first frame set a variable:

var counter:int = 0;

in the last frame:

counter ++

if(counter > 2){
// code for url
}
else{
this.gotoAndPlay(1);
}

Something like that.