# Can't access value in array - Please Help

**URL:** <https://forum.kirupa.com/t/cant-access-value-in-array-please-help/231872>\
**Category:** flash\
**Created:** [July 9, 2007, 7:18am UTC](https://forum.kirupa.com/t/cant-access-value-in-array-please-help/231872 "2007-07-09T07:18:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mfey/32/3661_2.png) [@mfey](https://forum.kirupa.com/u/mfey)\
**Post date:** [July 9, 2007, 7:18am UTC](https://forum.kirupa.com/t/cant-access-value-in-array-please-help/231872/1 "2007-07-09T07:18:03Z")

</div>

I have written the following code, and the function called by mcListener.onLoadComplete is returning the current value in the array as “undefined.” I want the current image that has finished loading to fade in, but “i” seems to have no meaning within the function. If i replace the \* with a number, it works fine. I think this is a scope issue but I can’t figure it out. Any help is much appreciated.

```auto
var thumbArray:Array = new Array;
var mcListener:Object = new Object;
var photoHolderLoader:MovieClipLoader = new MovieClipLoader;
photoHolderLoader.addListener(mcListener);

function creMenu(){
    for (i=0; i<total; i++) {
        var smallIm:MovieClip = smallPic.attachMovie("thumb","thumbNail"+i,i);
        thumbArray* = smallIm;
        thumbArray*._x = xPos*;
        thumbArray*._y = 0;
        thumbArray*._alpha = 0;
        photoHolderLoader.loadClip(image*, thumbArray*.inner_mc);
        mcListener.onLoadProgress = function(){
            trace("LOADING");
        };
        mcListener.onLoadComplete = function(){
            trace(thumbArray*);
        };
        
        smallIm.picVal = i;
        //THUMBS ROLLOVER/RELEASE
        thumbArray*.onRollOver = function(){
            this.alphaTo(50,1,"easeOutExpo");
        };
        thumbArray*.onRollOut = function(){
            this.alphaTo(100,1,"easeOutExpo");
        };
        thumbArray*.onRelease = function(){
            largePic.workPicMask.scaleTo(100,.5,"easeOutExpo");
            smallPic.alphaTo(0,.5,"easeOutExpo");
            p = this.picVal;
            largePic.picture.loadMovie(large[p], 1);
                largePic.desc_txt.text = caption[p];
                picture_num();
        };
        
    };
}

```
