# Looping xml gallery

**URL:** <https://forum.kirupa.com/t/looping-xml-gallery/284540>\
**Category:** Uncategorized\
**Created:** [March 20, 2009, 12:20am UTC](https://forum.kirupa.com/t/looping-xml-gallery/284540 "2009-03-20T00:20:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djsand](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@djsand](https://forum.kirupa.com/u/djsand)\
**Post date:** [March 20, 2009, 12:20am UTC](https://forum.kirupa.com/t/looping-xml-gallery/284540/1 "2009-03-20T00:20:37Z")

</div>

HI there , thanks for taking the time to look at this,  
Hello I am a newbee, and I am trying to understand this following code made for a photo gallery. I do get the all process however I have been trying to make the “the fullImage\_mc2” movie loop or going back to the first slide …without any luck

Some help or suggestion would be most welcome…

Thank you  
code:

myGalleryXML.onLoad = function() {  
gallery\_x = myGalleryXML.firstChild.attributes.gallery\_x;  
gallery\_y = myGalleryXML.firstChild.attributes.gallery\_y;  
gallery\_width = myGalleryXML.firstChild.attributes.gallery\_width;  
gallery\_height = myGalleryXML.firstChild.attributes.gallery\_height;  
myImages = myGalleryXML.firstChild.childNodes;  
myImagesTotal = myImages.length;  
//numimages = myImagesTotal;  
//trace("myImagesTotal "+myImagesTotal);  
info\_image = myImagesTotal;

```
//trace("myImagesTotal= "+myImagesTotal);
swa_page = myImagesTotal/15;
info_text.text = "Total Image: "+myImagesTotal;
//trace("Total Page= "+swa_page);
//page_text.text = swa_page;
onEnterFrame = function () {
    b = swa_page;
    test(b);
    delete this.onEnterFrame;
};
//
thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
thumb_width = myGalleryXML.firstChild.attributes.thumb_width;
full_x = myGalleryXML.firstChild.attributes.full_x;
full_y = myGalleryXML.firstChild.attributes.full_y;
callThumbs();
createMask();

```

};  
var \_loc2 = 5;  
var \_loc3 = 22;  
var \_loc4 = 1;

function callThumbs() {  
swarup.createEmptyMovieClip(“container\_mc”, 0);  
//container\_mc.attachMovie(“txt”, getNextHighestDepth());  
//container\_mc.\_x = gallery\_x;  
//container\_mc.\_y = gallery\_y;  
var clipLoader = new MovieClipLoader();  
var preloader = new Object();  
clipLoader.addListener(preloader);

```
for (i=0; i&lt;myImagesTotal; i++) {
    thumbURL = myImages*.attributes.thumb_url;
    //thum_swa = 
    //swa = container_mc*.attachMovie("txt", "txt", container_mc.getNextHighestDepth());
    myThumb_mc = swarup.container_mc.createEmptyMovieClip(i, +i);
    //mytxt_mc = attachMovie("txt", "txt"+i, getNextHighestDepth());
    myN = eval("container_mc"+i);
    //trace("ddddd+ "+mytxt_mc);
    //for (var j in _parent.container_mc) {
    //}
    //trace("myThumb_mc= "+swa)
    //myThumb_mc._y = thumb_height*i;
    myThumb_mc._x = mytxt_mc._x=_loc3;
    myThumb_mc._y = mytxt_mc._y=_loc2;
    if (_loc4 == 3) {
        _loc3 = _loc3+97;
        _loc2 = 5;
        _loc4 = 0;
    } else {
        _loc2 = _loc2+100;
    }
    ++_loc4;
    clipLoader.loadClip("photos/collection/thumbs/"+thumbURL, myThumb_mc);
    preloader.onLoadStart = function(target) {
        //attachMovie("my_love", target.getNextHighestDepth,0,0,100,20);
        target.createTextField("my_txt", target.getNextHighestDepth, 0, 0, 100, 20);
        target.my_txt.selectable = false;
        target.my_txt.color = 0xFFFFFF;
    };
    preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
        target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
        target.my_txt.color = 0xFFFFFF;
    };
    preloader.onLoadComplete = function(target) {
        new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
        //target.my_txt.removeTextField();
        target.my_txt.color = 0xFFFFFF;
        target.my_txt.text = "";
        target.onRelease = function() {
            this._alpha = 100;
            fullImage_mc2.removeMovieClip();
            callFullImage(this._name);
            //trace("callFullImage= = "+this._name);
            fullImage_mc2.my_mun.text = this._name;
            tt.removeTip();
        };
        target.onRollOver = function() {
            this._alpha = 50;
            //tooltip._visible = true;
            //tooltip.testo = "HI";
            //tt.showTip(this._name);
            calltips(this._name);
            //trace("onRollOver");
            //attachMovie("tips", "tips", getNextHighestDepth(), {_x:_xmouse, _y:_ymouse});
        };
        target.onRollOut = function() {
            this._alpha = 100;
            //tooltip._visible = false;
            //tips.removeMovieClip();
            tt.removeTip();
        };
    };
}

```

}  
//  
function calltips(myNumber) {  
myURL2 = myImages[myNumber].attributes.full\_url;  
myTitle2 = myImages[myNumber].attributes.title;  
myStyle\_Info2 = myImages[myNumber].attributes.style\_info;  
myDescribtion2 = myImages[myNumber].attributes.describtion;  
//trace("myStyle\_Info= "+myStyle\_Info2);  
tt.showTip(myTitle2);  
}  
//  
function callFullImage(myNumber) {  
next\_btn.enabled = false;  
pre\_btn.enabled = false;  
myURL = myImages[myNumber].attributes.full\_url;  
//trace("GUBLU============ "+myURL)  
myTitle = myImages[myNumber].attributes.title;  
myStyle\_Info = myImages[myNumber].attributes.style\_info;  
myDescribtion = myImages[myNumber].attributes.describtion;

```
//trace("callFullImage url= "+myURL);
//trace("myStyle_Info= "+myStyle_Info);
//createEmptyMovieClip("fullImage_mc",getNextHighestDepth());
attachMovie("fullImage_mc2", "fullImage_mc2", getNextHighestDepth());
fullImage_mc2.pic_l.createEmptyMovieClip("fullImage_mc", getNextHighestDepth());
//fullImage_mc._x = full_x;
//fullImage_mc._y = full_y;
var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);
fullPreloader.onLoadStart = function(target) {
    fullImage_mc2.lod = "";
    
};
fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
    
    fullImage_mc2.lod = Math.floor((loadedBytes/totalBytes)*100);
};
fullPreloader.onLoadComplete = function(target) {
    new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
    //target.my_txt.text = myTitle;
    fullImage_mc2.my_title.text = myTitle;
    fullImage_mc2.my_style.text = myStyle_Info;
    fullImage_mc2.my_describtion.text = myDescribtion;
    fullImage_mc2.lod = "";
    //fullImage_mc2.lod._visible = false
    //fullImage_mc2.my_mun.text = this._name;
};
fullClipLoader.loadClip("photos/collection/full_images/"+myURL, fullImage_mc2.pic_l.fullImage_mc);
//trace("photos/collection/full_images/"+myURL)

```

}

//slideshow  
function callSlideShow(myNumber) {  
trace(“callSlideShow”);  
fullImage\_mc2.my\_mun.text = “”;  
myURL3 = myImages[myNumber].attributes.full\_url;  
myTitle3 = myImages[myNumber].attributes.title;  
myStyle\_Info3 = myImages[myNumber].attributes.style\_info;  
myDescribtion3 = myImages[myNumber].attributes.describtion;  
trace("myStyle\_Info= "+myStyle\_Info);  
trace("callSlideShow= "+myURL);  
//createEmptyMovieClip(“fullImage\_mc”,getNextHighestDepth());  
//attachMovie(“fullImage\_mc2”,“fullImage\_mc2”,getNextHighestDepth());  
fullImage\_mc2.pic\_l.createEmptyMovieClip(“fullImage\_mc”, getNextHighestDepth());

```
//fullImage_mc._x = full_x;
//fullImage_mc._y = full_y;
var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);
fullPreloader.onLoadStart = function(target) {
    fullImage_mc2.lod = "";
    
    //target.createTextField("my_txt",fullImage_mc2.pic_l.fullImage_mc.getNextHighestDepth,0,0,200,20);
    //target.my_txt.selectable = false;
};
fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
    //target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
    fullImage_mc2.lod = Math.floor((loadedBytes/totalBytes)*100);
};
fullPreloader.onLoadComplete = function(target) {
    new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
    //target.my_txt.text = myTitle3;
    fullImage_mc2.my_title.text = myTitle3;
    fullImage_mc2.my_style.text = myStyle_Info3;
    fullImage_mc2.my_describtion.text = myDescribtion3;
    fullImage_mc2.my_mun.text = myNumber*1;
    //trace("SWA-myNumber= "+myNumber);
    slide.gotoAndPlay(3);
    fullImage_mc2.lod = "";
    //trace("IMAGE LOAD DONE")
};
fullClipLoader.loadClip("photos/collection/full_images/"+myURL3, fullImage_mc2.pic_l.fullImage_mc);

```

}  
//next  
function callSlideNext(myNumber) {  
trace(“callSlideShow”);  
//fullImage\_mc2.my\_mun.text = “”;  
myURL4 = myImages[myNumber].attributes.full\_url;  
myTitle4 = myImages[myNumber].attributes.title;  
myStyle\_Info4 = myImages[myNumber].attributes.style\_info;  
myDescribtion4 = myImages[myNumber].attributes.describtion;  
trace("myStyle\_Info= "+myStyle\_Info);  
trace("callSlideShow= "+myURL);

```
//createEmptyMovieClip("fullImage_mc",getNextHighestDepth());
//attachMovie("fullImage_mc2","fullImage_mc2",getNextHighestDepth());
fullImage_mc2.pic_l.createEmptyMovieClip("fullImage_mc", getNextHighestDepth());
//fullImage_mc._x = full_x;
//fullImage_mc._y = full_y;
var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);
fullPreloader.onLoadStart = function(target) {
    fullImage_mc2.lod = "";
    //target.createTextField("my_txt",fullImage_mc2.pic_l.fullImage_mc.getNextHighestDepth,0,0,200,20);
    //target.my_txt.selectable = false;
};
fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
    //target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
    fullImage_mc2.lod = Math.floor((loadedBytes/totalBytes)*100);
};
fullPreloader.onLoadComplete = function(target) {
    new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
    //target.my_txt.text = myTitle4;
    fullImage_mc2.my_title.text = myTitle4;
    fullImage_mc2.my_style.text = myStyle_Info4;
    fullImage_mc2.my_describtion.text = myDescribtion4;
    fullImage_mc2.my_mun.text = myNumber*1;
    //trace("SWA-myNumber= "+myNumber);
    //slide.gotoAndPlay(3);
    //trace("IMAGE LOAD DONE")
    fullImage_mc2.lod = "";
};
fullClipLoader.loadClip("photos/collection/full_images/"+myURL4, fullImage_mc2.pic_l.fullImage_mc);

```

}
