My FLASH movie repeats the last 100 frames indefinitely (the end of the move does a goToAndPlay() to repeat them). in these frames, i go to place an object at a random location. the first time it loads the movie it loads a random location, but when these frames repeat, the object loads in the SAME location, not a random one.
my random number code for the object looks as follows:
technically, if an object is on a timeline, the onLoad (your onClipEvent (load)), will run only once, because it has been loaded already.
What you want to do is control it’s position from a frame, most likely the first frame. That way, you will definitely know those actions will be called.
//from first frame
obj._x = random(300); //of course, replace 'obj' with the name of the object
obj._y = random(300);
So imagine the movie picks the random numbers 216 and 12. Instance starBright of star_alpha then plays at the random location (216,12). All is great so far.
At the end of the movie, the movie executes a [AS]goToFrame(2);[/AS]. Thus it loops back.
When the movie again gets to frame 2, the starBright movie plays again. However, it plays at the same location, in this example (216,12), instead of playing at a [COLOR=red]NEW, DIFFERENT RANDOM location[/COLOR]. lol.
Do I declare a new object in frame 2? Do I unload the movie in frame 75?
All suggestions welcome. Attached is the watered down movie if it helps at all.