# Why not this codes not working!

**URL:** <https://forum.kirupa.com/t/why-not-this-codes-not-working/252038>\
**Category:** Uncategorized\
**Created:** [February 15, 2008, 5:31am UTC](https://forum.kirupa.com/t/why-not-this-codes-not-working/252038 "2008-02-15T05:31:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nameez](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@nameez](https://forum.kirupa.com/u/nameez)\
**Post date:** [February 15, 2008, 5:31am UTC](https://forum.kirupa.com/t/why-not-this-codes-not-working/252038/1 "2008-02-15T05:31:19Z")

</div>

```auto
var cat_pointer:MovieClip = new MovieClip();
var mcLoader:MovieClipLoader = new MovieClipLoader();
var cat_listner:Object = new Object();

cat_listner.onLoadComplete = function(image_mc:MovieClip):Void {
   trace(image_mc.cat_id)) // [COLOR=Blue] **says undefined** [/COLOR]
}

function populate_cat_images(in_arr:Array, element:Number):Void {
    for (i=0; i<in_arr[element].product.length; i++) {
        cat_pointer.attachMovie("catagory_images", "img_holder"+i, cat_pointer.getNextHighestDepth(), {_y:115*i+5, _x:5});
        cat_pointer["img_holder"+i].cat_id = in_arr*.cat_id;
        mcLoader.loadClip(in_arr[element].product*.prd_thmbb, cat_pointer["img_holder"+i]);
    }
   mcLoader.addListener(cat_listner);
}

populate_cat_images(myArray, 5)

```

why does the trace statement on onLoadComplete says undefined???:tired:
