# Timing random stuff

**URL:** <https://forum.kirupa.com/t/timing-random-stuff/24307>\
**Category:** Uncategorized\
**Created:** [June 28, 2003, 6:35pm UTC](https://forum.kirupa.com/t/timing-random-stuff/24307 "2003-06-28T18:35:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebigcheese](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@thebigcheese](https://forum.kirupa.com/u/thebigcheese)\
**Post date:** [June 28, 2003, 6:35pm UTC](https://forum.kirupa.com/t/timing-random-stuff/24307/1 "2003-06-28T18:35:10Z")

</div>

Hi - i created a movie that gets a certain number of nodes from an xml file and places them randomly on the screen.

The only thing is, that it does them at the same time. i want them each to be placed seperatly on the stage, getting faster as the movie progresses.

I have attached the files below, how would i do this.  
i want the end result to look something like this:  
[http://www.ianschragerhotels.com/intro.html](http://www.ianschragerhotels.com/intro.html)  
(not the intro with the black bg)

the xml is loacted at:  
[http://jobs.mindtripstudios.com/launch3/lib/countries.xml](http://jobs.mindtripstudios.com/launch3/lib/countries.xml)

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 28, 2003, 6:42pm UTC](https://forum.kirupa.com/t/timing-random-stuff/24307/2 "2003-06-28T18:42:20Z")

</div>

use setInterval()… look it up in your AS reference 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 28, 2003, 6:57pm UTC](https://forum.kirupa.com/t/timing-random-stuff/24307/3 "2003-06-28T18:57:12Z")

</div>

ok - i did that and now they all come seperatly but they dont stay on the stage, how would i get them to stay on the stage.

Also, it does to many, i only want it to do the function a certain amount of times and in order to do this i put it in a for loop like this:

```auto
for (i=0; i<5; i++) {
	setInterval(printC, i+100);
}

```

But it doesn’t work, it happens more than 5 times.

How would i fix these two things - thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 28, 2003, 7:15pm UTC](https://forum.kirupa.com/t/timing-random-stuff/24307/4 "2003-06-28T19:15:20Z")

</div>

i also tried this with do and dow…while but it still didnt work
