# Referencing Loaders in an Array

**URL:** <https://forum.kirupa.com/t/referencing-loaders-in-an-array/311126>\
**Category:** flash\
**Created:** [June 28, 2010, 4:41pm UTC](https://forum.kirupa.com/t/referencing-loaders-in-an-array/311126 "2010-06-28T16:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![albino](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/albino/32/1022_2.png) [@albino](https://forum.kirupa.com/u/albino)\
**Post date:** [June 28, 2010, 4:41pm UTC](https://forum.kirupa.com/t/referencing-loaders-in-an-array/311126/1 "2010-06-28T16:41:32Z")

</div>

Hi,

I have a project that needs 4 levels of zoom, each with its own image loading in. So, to make things easier on myself, I made an array of the Loaders, so I can instantiate them and hide/display them when I need to. However, this doesn’t work as I had expected. I.e. (using just two level for simplicity):

```auto
private var photo:Loader;
private var photoLarge:Loader;
private var photoArray:Array = [photo, photoLarge];

trace(photoLoader[0] == photo) // true
photoLoader[0] = new Loader();
trace(photoLoader[0] == photo) // false

```

Now i guess this is because I am overwriting the array reference with a new Loader object. But even if I do:

```auto
var temp:Loader = photoLoader[0];
trace(temp == photo) // true
temp = new Loader();
trace(temp == photo) // false

```

Is there any way I can reference the loaders dynamically so I can load/show/hide them on the fly, instead of hard coding it for each level?

Thanks in advance!
