# Array index undefined

**URL:** <https://forum.kirupa.com/t/array-index-undefined/323574>\
**Category:** Uncategorized\
**Created:** [July 7, 2011, 5:44pm UTC](https://forum.kirupa.com/t/array-index-undefined/323574 "2011-07-07T17:44:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonassus](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bonassus](https://forum.kirupa.com/u/bonassus)\
**Post date:** [July 7, 2011, 5:44pm UTC](https://forum.kirupa.com/t/array-index-undefined/323574/1 "2011-07-07T17:44:37Z")

</div>

I’m loading Mp3 files with the greensock loadermax MP3Loaders and then using push(event.target.content) to store them in the array, notesArray. When I trace(notesArray); I get :  
[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound]

so event.target.content is a sound object that contains the mp3?

But when i trace(notesArray[0]); I get:  
undefined

Why? how can i access each sound object/ mp3 as an index of the array? what am i doing wrong?

here is the code:

```auto
package {
   import com.greensock.loading.*;
   import com.greensock.events.LoaderEvent;
   
   public class NoteLoader {
         
         private var queue:LoaderMax;
         public var notesArray:Array = [];
         
         public var note2_A;
         public var note2_A_S;
         public var note2_B;
         public var note2_C;
         public var note2_C_S;
         public var note2_D;
         public var note2_D_S;
         public var note2_E;
         public var note2_F;
         public var note2_F_S;
         public var note2_G;
         public var note2_G_S;
         
      public function NoteLoader() {
      
          queue = new LoaderMax({name:"mainQueue", onComplete:completeHandler});
            queue.append(note2_A = new MP3Loader("2_A.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_A_S = new MP3Loader("2_A#.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_B = new MP3Loader("2_B.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_C = new MP3Loader("2_C.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_C_S = new MP3Loader("2_C#.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_D = new MP3Loader("2_D.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_D_S = new MP3Loader("2_D#.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_E = new MP3Loader("2_E.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_F = new MP3Loader("2_F.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_F_S = new MP3Loader("2_F#.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_G = new MP3Loader("2_G.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            queue.append(note2_G_S = new MP3Loader("2_G#.mp3", {autoPlay:false,estimatedBytes:25000 }) );
            
                  queue.prependURLs("Notes/");
                   queue.load();
      }
      
      function completeHandler(event:LoaderEvent):void {
            notesArray.push(event.target.content);
            
            // trace(notesArray[0]); undefined???????? 
               
               
      }

   }
   
}

```

Thanks!
