Skip to main content
November 27, 2006
Question

Random movie loads

  • November 27, 2006
  • 2 replies
  • 191 views
I am loading movies at random starting with the following AS:

this.createEmptyMovieClip("bground", 1);
bground._x = 0;
bground._y = 0;

var myClips:Array = new Array("buzz_design1.swf", "buzz_design2.swf", "buzz_design3.swf", "buzz_design4.swf", "buzz_design5.swf", "buzz_design6.swf", "buzz_design7.swf");

var currentClip = random(myClips.length);
bground.loadMovie("buzzwords/" + myClips[currentClip]);

stop();


At the end of each loaded MC I have:
this.loadMovie("buzzwords/" + _root.myClips[random(_root.myClips.length)]);

stop();


How do I ensure the same movie is not loaded twice in a row? Many thanks.
This topic has been closed for replies.

2 replies

November 27, 2006
I'll look into this, thanks.
November 27, 2006
one option would be:

you can save the name of the random movie ( or the index in the movie array) in a shared object ( works just like cookie) and every time your program starts it checked the shared object and make sure you do not show this video
here is explanation about shared object:
http://www.actionscripthero.com/blog/shared_objects/

hope this help