Skip to main content
Known Participant
July 4, 2013
Answered

how to load 2 xml galleries in single function loop.

  • July 4, 2013
  • 1 reply
  • 395 views

how to load 2 xml galleries in single function loop.

my function is--------

var myGalleryXML = new XML();

myGalleryXML.ignoreWhite = true;

myGalleryXML.load("gallery.xml");

function callThumbs()

{

    _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());

    wall._x = _root.gallery_x;

    wall._y = _root.gallery_y;

    wall.addEventListener(MouseEvent.CLICK);

    var clipLoader = new MovieClipLoader();

    var preloader = new Object();

    clipLoader.addListener(preloader);

   

        for (i =0; i <6; i++)

   

    {

        thumbURL = myImages.attributes.thumb_url;

        myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());

        myThumb_mc._x = _root.thumb_height * i;

        myThumb_mc._x = _root.thumb_position = -3100 + (i-j) * 765;

       

   clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery1.xml"

preloader.onLoadStart = function(target)

        {

            target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);

            target.my_txt.selectable = false;

        };

        preloader.onLoadProgress = function(target, loadedBytes, totalBytes)

        {

            target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);

        };

        preloader.onLoadComplete = function(target)

        {

            new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);

            target.my_txt.removeTextField();

            target.onRelease = function()

            {

                callFullImage(this._name);

            };

            target.onRollOver = function()

            {

                this._alpha = 100;

            };

            target.onRollOut = function()

            {

                this._alpha = 100;

            };

        };

   

   

    }

   

    for (i = 0; i < 6; i++)

   

    {

        thumbURL = myImages.attributes.thumb_url;

        myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());

        myThumb_mc._x = _root.thumb_height * i;

        myThumb_mc._x = _root.thumb_position = -7210 + (i-j) * 765;

        myThumb_mc._y = _root.thumb_position = 180;

        clipLoader.loadClip("banner/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery2.xml"

        preloader.onLoadStart = function(target)

        {

            target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);

            target.my_txt.selectable = false;

        };

        preloader.onLoadProgress = function(target, loadedBytes, totalBytes)

        {

            target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);

        };

        preloader.onLoadComplete = function(target)

        {

            new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);

            target.my_txt.removeTextField();

            target.onRelease = function()

            {

                callFullImage(this._name);

            };

            target.onRollOver = function()

            {

                this._alpha = 100;

            };

            target.onRollOut = function()

            {

                this._alpha = 100;

            };

        };

    }

}

This topic has been closed for replies.
Correct answer kglad

combine the two xml files into one if you want to create one gallery.

if you want two different galleries that display at different times, remove the movieclip wall after you're done with gallery1 and execute myGalleryXML.load("gallery2.xml");

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 4, 2013

combine the two xml files into one if you want to create one gallery.

if you want two different galleries that display at different times, remove the movieclip wall after you're done with gallery1 and execute myGalleryXML.load("gallery2.xml");