# Better way for this Loader and issue

**URL:** <https://forum.kirupa.com/t/better-way-for-this-loader-and-issue/239980>\
**Category:** Uncategorized\
**Created:** [September 27, 2007, 9:18pm UTC](https://forum.kirupa.com/t/better-way-for-this-loader-and-issue/239980 "2007-09-27T21:18:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mediashock](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mediashock](https://forum.kirupa.com/u/Mediashock)\
**Post date:** [September 27, 2007, 9:18pm UTC](https://forum.kirupa.com/t/better-way-for-this-loader-and-issue/239980/1 "2007-09-27T21:18:33Z")

</div>

I am fairly new to AS3 but here is my code

```auto
   
function attach(p:XML) {
	   var plist:XMLList = p.project;
		numOfItems = plist.length();
		//trace(numOfItems);
	
	 for (var i = 0; i < numOfItems; i++)
    {
       var t = new item();
       t.name = "item_"+i;
       t.addEventListener(Event.ENTER_FRAME, render);
	   t.tooltext = plist.name*.text();

	   var pictLdr:Loader = new Loader();
	   pictLdr.load(new URLRequest(plist.thumb*.text()))
	   t.icon.inner.addChild(pictLdr);
	   t.r.inner.addChild(pictLdr);
           addChild(t);   
    }	   
   }

```

The issue is with the loader… what would be the most efficient way of doing this… i have a feeling there is more efficient way of doing the loader…

issue #2 - using this method the picLdr will only addChild to the last one t.r.inner… and not the first one… if i remove the t.r.inner it will load it to the icon one. i need to load it to both.
