# Get child variables

**URL:** <https://forum.kirupa.com/t/get-child-variables/311377>\
**Category:** Uncategorized\
**Created:** [July 5, 2010, 7:48am UTC](https://forum.kirupa.com/t/get-child-variables/311377 "2010-07-05T07:48:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![holborner](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@holborner](https://forum.kirupa.com/u/holborner)\
**Post date:** [July 5, 2010, 7:48am UTC](https://forum.kirupa.com/t/get-child-variables/311377/1 "2010-07-05T07:48:08Z")

</div>

Hi all  
I’m doing an XML gallery kind of thing that I need to assign a title to each image.

I created a Dictionary object “titleImageMap” to store the titles. Then placed them into each MC using the variable name colName.

```auto

function loadImages(collectionList:XML):void {
            var imageList:XMLList=collectionList.collection.img;
            var titleList:XMLList=collectionList.collection.coltitle;
            createContainer();
            thumbTotal=imageList.length();
            for (var i:Number=0; i<imageList.length(); i++) {
                var img_url=imageList*;
                var img_loader=new Loader ;
                titleImageMap[img_loader]=titleList*;
                img_loader.load(new URLRequest(img_url));
                img_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageLoaded);
                img_loader.name=i;
            }

        }

function imageLoaded(e:Event):void {
            var my_thumb:Loader=Loader(e.target.loader);
            thumbContainer = new MovieClip();
            thumbContainer.addChild(my_thumb);
            thumbContainer.colName=titleImageMap[my_thumb];
            my_thumb.x = 0-(my_thumb.width/2);
            my_thumb.y = 0-(my_thumb.height/2);

            var xPosid=my_thumb.name;
            container_mc.addChild(thumbContainer);
            thumbContainer.name="thumb"+my_thumb.name;
            trace(thumbContainer.colName); //tracing worked
            thumbContainer.x=350*xPosid;
            thumbContainer.alpha=0;
            TweenLite.to(thumbContainer,0.5,{alpha:1,ease:Quint.easeInOut});

        }

```

Tracing worked, so the colName variable is attached to each thumbContainer inside the container\_mc.

Now I try to retrieve the colName from a button, but stuck on how to access it…it keeps chucking a 1119 error

1119: Access of possibly undefined property colName through a reference with static type flash.display:DisplayObject.
