# Attached movies not working

**URL:** <https://forum.kirupa.com/t/attached-movies-not-working/201401>\
**Category:** Uncategorized\
**Created:** [September 20, 2006, 10:52pm UTC](https://forum.kirupa.com/t/attached-movies-not-working/201401 "2006-09-20T22:52:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jupiter](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jupiter/32/827_2.png) [@jupiter](https://forum.kirupa.com/u/jupiter)\
**Post date:** [September 20, 2006, 10:52pm UTC](https://forum.kirupa.com/t/attached-movies-not-working/201401/1 "2006-09-20T22:52:23Z")

</div>

Please can someone look at my code and explain why the attached movies when they are bigger than the stage go to the next line but tahy stay all in the same location

```auto

Stage.scaleMode = "noScale";
Stage.align = "TL";
var galXml:XML = new XML();
galXml.ignoreWhite = true;
this.createEmptyMovieClip("holder", this.getNextHighestDepth());
var gap:Number;
galXml.onLoad = function(yes) {
    if (yes) {
        var xmlRoot = this.firstChild;
        trace(xmlRoot.childNodes.length);
        _global.total=xmlRoot.childNodes.length
        for (var i:Number = 0; i<xmlRoot.childNodes.length; i++) {
            var photos = xmlRoot.childNodes*;
            //var leg = xmlRoot.childNodes*.firstChild.firstChild.nodeValue;
            var pic = xmlRoot.childNodes*.lastChild.firstChild.nodeValue;
            //trace(pic);
            var pictures = holder.attachMovie("thumb_mc", "thumb_mc"+i, i);
            pictures.empty_mc.loadMovie(pic);
            /*
            pictures._x = 0+(pictures._width+10)*i;
            if (holder._width>Stage.width) {
                pictures._x=0+gap
                pictures._y = 150;
                gap+=180
            }
            */
            if (i == xmlRoot.childNodes.length-1) {
                trace(holder._width);
                
            }
        }
    } else {
        _root.info_txt.text = "there was an error loading the xml";
    }
};
galXml.load("xml/gallery.xml");

```

the xml

```auto

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<gallery>
    <photo>
        <name>Alexandre </name>
        <img>images/small/alex_thumb_1.jpg</img>
    </photo>
    <photo>
        <name>Angela </name>
        <img>images/small/ni_thumb_1.jpg</img>
    </photo>
    
        <photo>
        <name>Alexandre </name>
        <img>images/small/alex_thumb_1.jpg</img>
    </photo>
    <photo>
        <name>Angela </name>
        <img>images/small/ni_thumb_1.jpg</img>
    </photo>
    
        <photo>
        <name>Alexandre </name>
        <img>images/small/alex_thumb_1.jpg</img>
    </photo>
    <photo>
        <name>Angela </name>
        <img>images/small/ni_thumb_1.jpg</img>
    </photo>

</gallery>

```

thanks
