# XML Flash Gallery Again

**URL:** <https://forum.kirupa.com/t/xml-flash-gallery-again/240130>\
**Category:** flash\
**Created:** [September 29, 2007, 1:22pm UTC](https://forum.kirupa.com/t/xml-flash-gallery-again/240130 "2007-09-29T13:22:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikitosss](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@nikitosss](https://forum.kirupa.com/u/nikitosss)\
**Post date:** [September 29, 2007, 1:22pm UTC](https://forum.kirupa.com/t/xml-flash-gallery-again/240130/1 "2007-09-29T13:22:40Z")

</div>

Here is my gallery code:

```php

var thumb_spacing = 24;
function GeneratePortfolio(portfolio_xml){
    var portfolioPictures = portfolio_xml.firstChild.childNodes;
    for (var i = 0; i < portfolioPictures.length; i++){
        var currentPicture = portfolioPictures*;                
        var currentThumb_mc = menu_mc.attachMovie("button", "but_mc", i);
        currentThumb_mc._x = i * thumb_spacing;        
        
        currentThumb_mc.image = currentPicture.attributes.image;        
        currentThumb_mc.onRollOver = function(){
            menu_mc.but_mc.gotoAndPlay(1);
        }
        currentThumb_mc.onRollOut = function(){
            menu_mc.but_mc.gotoAndPlay(8);
        }
        currentThumb_mc.onRelease = function(){
            image_mc.loadMovie(this.image);
            
            
        }
        
    }
}

var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
    if (success) GeneratePortfolio(this);
    else trace("Error loading XML file"); 
}

portfolio_xml.load("portfolio.xml");

```

In this gallery i’ve made instead of thumbnail, movie clips with an animation inside, when i make attachmovie() everything works good, until RollOver/Rollout functions starts working.  
The problem is: All of attached movieclips should have small animation, but when I make rollover,(on any of this movieclips) i can see animation only of the first.
