# Challenge - scrolling images loaded from xml?

**URL:** <https://forum.kirupa.com/t/challenge-scrolling-images-loaded-from-xml/266774>\
**Category:** Uncategorized\
**Created:** [July 24, 2008, 5:41am UTC](https://forum.kirupa.com/t/challenge-scrolling-images-loaded-from-xml/266774 "2008-07-24T05:41:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob\_the\_bat2](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@bob\_the\_bat2](https://forum.kirupa.com/u/bob_the_bat2)\
**Post date:** [July 24, 2008, 5:41am UTC](https://forum.kirupa.com/t/challenge-scrolling-images-loaded-from-xml/266774/1 "2008-07-24T05:41:14Z")

</div>

hey all,  
I have a somewhat advanced flash question. Im constructing a gallery using xml. My code isn’t too different from most xml galleries. But heres what I can’t figure out or even know if it can be done. After clicking the links (currentThumb\_mc) my full res images come up to view. All my .jpg’s/full res images are the same height but they all differ in widths.

I have a mask set up where the full res images get loaded to. My question is can i set up code to scroll the current loaded image behind my mask and have the edges stop at the mask width.

This may be tricky because all the .jpg’s/full res images are different widths. I assume you need to get the x property of the loaded images. im not too familiar with that.

any help is greatly appreciated. thanks.

below is my code

```auto

fscommand("fullscreen", true);
Stage.scaleMode = "noScale";
Stage.align = "TL";

// start full image loader blank
full_mc._visible = false;
_root.full_mc.stroke_mc._visible = false;

/* start code for xml*/

var link_spacing = 15;
var item_count = 0;

// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text) {
    full_mc.fullText_mc.description_txt.text = raw_text;
};

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("menu_item", "item"+item_count, item_count);
        currentThumb_mc._y = i*link_spacing;
        item_count++;

        currentThumb_mc.info_txt.text = currentPicture.attributes.title;//load links in a row
       

        /* url's */
        currentThumb_mc.title = currentPicture.attributes.title;//title
        currentThumb_mc.image = currentPicture.attributes.image;//full
        currentThumb_mc.description = currentPicture.attributes.description;//text
        currentthumb_mc.subhead = currentPicture.attributes.subhead;// subhead

        /* trace */
        trace(currentPicture.attributes.title);//title
        trace(currentPicture.attributes.description);//text
        trace(currentPicture.attributes.image);//full
        trace(currentPicture.attributes.thumb);//thumb
        trace(currentPicture.attributes.subhead);//subhead

        /* sets code for ANY rollover functions */
        currentThumb_mc.onRollOver = currentThumb_mc.onDragOver=function () {
            this.gotoAndPlay("over");
        };
        currentThumb_mc.onRollOut = currentThumb_mc.onDragOut=function () {
            this.gotoAndPlay("out");
        };

currentThumb_mc.onRelease = function() {
            full_mc.fullText_mc.subhead_txt.text = (this.title);
            full_mc._visible = true;
            full_mc.gotoAndPlay("start");
            full_mc.image_mc.loadMovie(this.image);
            full_mc.fullText_mc.description_lv.load(this.description);
        };
    }
}

// mask artwork
full_mc.setMask(imageMask);

```
