# Can this be done in an array?

**URL:** <https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609>\
**Category:** Uncategorized\
**Created:** [October 21, 2003, 2:51pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609 "2003-10-21T14:51:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inflicted](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@Inflicted](https://forum.kirupa.com/u/Inflicted)\
**Post date:** [October 21, 2003, 2:51pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/1 "2003-10-21T14:51:36Z")

</div>

I have a movie with 6 containers that load jpg’s: container\_1, container\_2 etc.  
They all have the same action. Instead of copying the code for every instance, can I put this in an array?

How would I do that? Couldn’t find the appropriate tut or thread.

```auto
container_1._alpha = 0;
this.onEnterFrame = function() {
        loadMovie("image1.jpg", "container_1");

```

Any help’s appreciated!

regards

---

<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:** [October 21, 2003, 3:41pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/2 "2003-10-21T15:41:28Z")

</div>

This question has been answered many times 🙂

---

<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:** [October 21, 2003, 3:47pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/3 "2003-10-21T15:47:20Z")

</div>

And your code makes no sense to me…  
why is the loadMovie inside the onEnterFrame handler? You could just use loadMovie

---

<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:** [October 21, 2003, 3:52pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/4 "2003-10-21T15:52:42Z")

</div>

> \*Originally posted by Ilyas da Pom \*  
> \*\*This question has been answered many times 🙂 \*\*

This, apparently, is not one of those times 😛

---

<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:** [October 21, 2003, 3:54pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/5 "2003-10-21T15:54:39Z")

</div>

Just couldn’t find the right thread. But I know how to do it now…  
The code is indeed not right, but just a shortened example. Not very clever I admit.

Got a follow up question if you guys still have patience with me…

I want the containers to load the jpg’s with some delay between loading container\_1, container\_2 etc.

I tried putting the containers on a seperate frame, container\_1 on frame 1, container\_2 on frame 2 etc…Doesn’t work.

Do you know of a way to do this? I’ m just trying to expand my knowledge on AS.

Thanks again,

regards

---

<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:** [October 21, 2003, 3:58pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/6 "2003-10-21T15:58:01Z")

</div>

use setInterval

---

<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:** [October 21, 2003, 4:05pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/7 "2003-10-21T16:05:26Z")

</div>

Thanks senocular,

Do you have a tut or thread on this?

regards

---

<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:** [October 21, 2003, 4:24pm UTC](https://forum.kirupa.com/t/can-this-be-done-in-an-array/33609/8 "2003-10-21T16:24:06Z")

</div>

not on that exactly, but on setInterval, yes.

[http://www.umbc.edu/interactive/flash/tutorials/showpage.php?p=setInterval](http://www.umbc.edu/interactive/flash/tutorials/showpage.php?p=setInterval)
