# Need help with my arrays

**URL:** https://forum.kirupa.com/t/need-help-with-my-arrays/320452
**Category:** Uncategorized
**Created:** [March 24, 2011, 12:44am UTC](https://forum.kirupa.com/t/need-help-with-my-arrays/320452 "2011-03-24T00:44:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Theabso2004](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Theabso2004](https://forum.kirupa.com/u/Theabso2004)
#### Post date: [March 24, 2011, 12:44am UTC](https://forum.kirupa.com/t/need-help-with-my-arrays/320452/1 "2011-03-24T00:44:24Z")

</div>

Hey im trying to make a gallery in flash for a project and the coding isnt right Array 1 will play but arary 2 wont ☹ what am I doing wrong much thanks

```auto
import flash.utils.Timer;
import flash.events.TimerEvent;

var myarray:Array=["Anaconda.jpg","AlphaMax.jpg","Revolver.jpg","Tzone.jpg","WickedSiege.jpg","CSystem3.5.jpg","WildThing.jpg","Damage.jpg","Diamondback.jpg","LoadedRevolver.jpg"];
//This function is where my graphics are stored and where the loader1 will be pulling the picture files from.

var myarray2:Array=["Anaconda_text.jpg","AlphaMax_text.jpg","Revolver_text.jpg","Tzone_text.jpg","WickedSiege_text.jpg","3.5_text.jpg","WildThing_text.jpg","Damage_text.jpg","Diamondback_text.jpg","LoadedRevolver_text.jpg"];
//This function is where my other graphics are stored and where the loader2 will be pulling the picture files from.

var count:Number=0;
var depth:Number=0;
//these functions will keep a count of what images will be shown at a time.

var myTimer:Timer=new Timer(5000);
//this function starts my timer that will run every 5 seconds.

myTimer.addEventListener(TimerEvent.TIMER,move2next);
//this function sets my event listener to watch for the timer to trigger/start. When it triggers, it will run my function move2next.

function move2next(event:TimerEvent):void
{
if (count==myarray.length)
if (count==myarray2.length) //the if comment tells the program when it reaches the last item in my array. It will then set the count back to 0 to start over.
{
count=0;
}
//this code will shuffle back and forth between the z index of the images. It also changes when the uiloader appears.

trace(myarray2[count]);
trace(myarray[count]);
movieClip2.loader2.source=myarray2[count];
movieClip1.loader1.source=myarray[count];
//tells the loaders which files to grab from

count++;
}
//this allows the count to increase by 1 and move to the next image in the array.

myTimer.start();
//starts the actual timer.

```

you can download my FLA file here ugg please help

```auto
http://www.mediafire.com/?187r2rpjhgxpy3x

```
