Can this be done in an array?

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.

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

Any help’s appreciated!


This question has been answered many times :slight_smile:

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

*Originally posted by Ilyas da Pom *
**This question has been answered many times :slight_smile: **

This, apparently, is not one of those times :stuck_out_tongue:

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,


use setInterval

Thanks senocular,

Do you have a tut or thread on this?


not on that exactly, but on setInterval, yes.