# Problem with Image Gallery, Help!

**URL:** <https://forum.kirupa.com/t/problem-with-image-gallery-help/329379>\
**Category:** Uncategorized\
**Created:** [August 21, 2012, 1:34am UTC](https://forum.kirupa.com/t/problem-with-image-gallery-help/329379 "2012-08-21T01:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davydonna](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@davydonna](https://forum.kirupa.com/u/davydonna)\
**Post date:** [August 21, 2012, 1:34am UTC](https://forum.kirupa.com/t/problem-with-image-gallery-help/329379/1 "2012-08-21T01:34:10Z")

</div>

Hi, i need this gallery to be seperated from the thumbnails it interact. I need the button to open the Xmlgallery1 instead of the Xmlgallery. In other words, i want to load a different image than the thumbnails shows. Ive already copied the xml gallery to seperate it but i cannot find a way to load another xmlgallery…

Here the code, it is a simple vertical slider:

import flash.net.URLLoader;  
import flash.net.URLRequest;  
import flash.display.Loader;

var galleryXML1:XML;  
var galleryXML:XML;  
var xmlLoader:URLLoader;  
var xmlLoader1:URLLoader;  
var xmlRequest:URLRequest;  
var xmlRequest1:URLRequest;

xmlLoader1 = new URLLoader();  
xmlLoader = new URLLoader();  
xmlRequest1 = new URLRequest(‘galleryXML1.xml’);  
xmlRequest = new URLRequest(‘galleryXML.xml’);

var numOfImages:int;  
var numOfImages1:int;  
var currImage:int = 0;  
var currImage1:int = 0;

var imageLoader:Loader;  
var imageLoader1:Loader;  
var imageRequest:URLRequest;  
var imageRequest1:URLRequest;

imageLoader = new Loader();  
imageLoader1 = new Loader();

var imagesList:Array = new Array();  
var imagesList1:Array = new Array();  
var loadedImages:Array = new Array();  
var loadedImages1:Array = new Array();

xmlLoader.load(xmlRequest);  
xmlLoader.addEventListener(Event.COMPLETE,onComplete);

function onComplete(e:Event):void  
{  
galleryXML = new XML(xmlLoader.data);  
numOfImages = galleryXML.photo.length();  
var i:int = numOfImages;  
while(i–)  
{  
imagesList.push(String(galleryXML.photo\*.url));  
}  
startLoading();  
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadNex t);  
}

function startLoading():void{  
imageRequest = new URLRequest(imagesList[currImage]);  
imageLoader.load(imageRequest);  
}

function loadNext(e:Event):void  
{  
if(currImage == numOfImages-1)  
{  
loadedImages.push(imageLoader.content);  
imageLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,load Next);

```
                var i:int = galleryXML.photo.length();
                container = new Sprite();
                while(i--)
                {
                          var rect:Bitmap = loadedImages*;
                          var bitmapCont:Sprite = new Sprite();
                          bitmapCont.addChild(rect);
                          container.addChild(bitmapCont);
                          bitmapCont.y = i * 105;
                          bitmapCont.width = 118;
                          bitmapCont.height = 103;
                          bitmapCont.addEventListener(MouseEvent.CLICK,draw,false,0,true);
                          bitmapCont.addEventListener(MouseEvent.MOUSE_OVER,overFunc,false,0,tr ue);
                          bitmapCont.addEventListener(MouseEvent.MOUSE_OUT,outFunc,false,0,true );
                          rect.y = 540;

                }

                addChild(container);
                container.x = 960;
                addEventListener(Event.ENTER_FRAME,update);

                return;
      }

      loadedImages.push(imageLoader1.content);
      currImage++;
      imageRequest = new URLRequest(imagesList[currImage]);
      imageLoader.load(imageRequest);

```

}

function overFunc(e:Event):void  
{

}

function outFunc(e:Event):void  
{

}

import flash.display.Sprite;  
import flash.events.Event;  
import flash.display.BitmapData;  
import flash.display.Bitmap;  
import flash.events.MouseEvent;  
import flash.filters.BlurFilter;

var bd:BitmapData = new BitmapData(1080,1920,true,0x00000000);

var b:Bitmap = new Bitmap(bd);  
b.y = 0;  
b.x = 0;  
b.height = 1920;  
b.width = 1080;  
addChild(b);  
var container:Sprite

var vel:Number = 0;  
var acc:Number = 0;  
var damp:Number = 0.95;

function update(e:Event):void  
{  
acc = 0;  
if(mouseY\>1200)  
acc = - - - -1;  
if(mouseY\<550)  
acc = - - -1;  
vel +=acc;  
vel\*=damp;  
container.y += vel;  
if(container.y\>200)  
container.y = 200;  
if(container.y \< 730-container.height)  
container.y = 730-container.height;

}

function draw(e:MouseEvent):void  
{

```
      bd.draw(Sprite(e.currentTarget));

```

}
