Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Logo

Status
Not open for further replies.

joepeacock

Programmer
Nov 5, 2001
74
US
Okay, I have a logo with a random element. The randomized part is an animation chosen from several files that are not all the same length. Here's what I have so far:

The main file, with the static elements and an MC instance called "logomovie".
"Logomovie" is just one frame with a loadMovie action to call one of the random logo part movies, which are other SWF files.
No problems there.

What I want it to do is play the random animation, then reload a different random animation that is not the same one. So, instead of playing #2 over and over, it will play #2, then when #2 is done, play #4, then play #1, etc, randomly.

I can't get it to do this. It just keeps playing the same movie over and over again.

I read the FAQ about randomly loading banners, but it seemed to have some older syntax I'm not familiar with, and it is based on a timer, not on the length of the movie itself, which won't do me any good, with my different movie lengths.

Any help will be greatly appreciated. I am using Flash 5.
 
Copy the script that starts the random movie in the first place and paste it into the last frame of all of the random movieClips. That way, when each MC finishes playing they will hit the "load random MC" script and another MC will start playing. If you want to make sure that the same MC doesn't start playing again you'll have to get a little more technical ... somethig like storing the name of the currently playing MC in the main timeline when it loads, then running a timeline loop which 1) selects a new random movie, 2) checks the movie selected against the "currently playing" variable, and 3) plays the next MC if no match is made OR goes to the previous frame where it selects a new MC (starting the comparison loop again).

Hope this helps - yell if you need help.
 
Thanks for your suggestion. I was actually trying that, and it would not work. I wound up just creating a function in the main file and calling that function at the end of each of the movies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top