# \[HLP\] Odd Behavior when loading external file

**URL:** <https://forum.kirupa.com/t/hlp-odd-behavior-when-loading-external-file/263144>\
**Category:** flash\
**Created:** [June 12, 2008, 9:49pm UTC](https://forum.kirupa.com/t/hlp-odd-behavior-when-loading-external-file/263144 "2008-06-12T21:49:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_n00](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mr\_n00](https://forum.kirupa.com/u/mr_n00)\
**Post date:** [June 12, 2008, 9:49pm UTC](https://forum.kirupa.com/t/hlp-odd-behavior-when-loading-external-file/263144/1 "2008-06-12T21:49:27Z")

</div>

Hi, folks,

i’m starting my A.S. 3.0 path… I wrote this lil code to load external imgs (or swf) for a “slideshow”…

what’s happening here is:  
1st. Only the last img loads (or maybe they’re one in top of the other)  
2nd. The image load offset from the Mc center (the holder is centered on the thumb)…

so, my question is:  
How can i place all the images in the center of each movieclip generated by the loop? So they’re all shown and on the right spot.

here’s the code

```auto

var _xThumb:Number = 120;
var _yThumb:Number = 120;
var _thumb:Thumb;
var arrayReq:Array = ["01.jpg","02.jpg","03.jpg","04.jpg"]
var _thumbReq = new URLRequest();
var _thumbLoader:Loader = new Loader();
var conta:Number = 0;

        for (var i:Number = 0; i < 3; i++) {
            _thumb = new Thumb();
            _thumbReq = new URLRequest(arrayReq[conta]);
            _thumbLoader.load(_thumbReq);
            addChild(_thumb);
            _thumb.loader_mc.addChild(_thumbLoader);
            _thumb.x = _xThumb;
            _thumb.y = _yThumb;
            _xThumb += _thumb.width +20;
            trace(conta);
            conta ++;
        }

```

some explanation:  
thumb is a “square” movieClip with some animation(i made into a class)and with a Mc inside called loader\_mc (supposed to be the external file holder)… The reason is to have some animation on the over, out when hovered…

THANKS A MILLION for your patience,

cheers,

mr\_n00

---

<div class="post-metadata">

**Author:** ![mr\_n00](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mr\_n00](https://forum.kirupa.com/u/mr_n00)\
**Post date:** [June 13, 2008, 3:47am UTC](https://forum.kirupa.com/t/hlp-odd-behavior-when-loading-external-file/263144/2 "2008-06-13T03:47:21Z")

</div>

anyone?
