# Gallery Slideshow Issues ! Need Help in Resizing

**URL:** https://forum.kirupa.com/t/gallery-slideshow-issues-need-help-in-resizing/286839
**Category:** flash
**Created:** [April 21, 2009, 8:18pm UTC](https://forum.kirupa.com/t/gallery-slideshow-issues-need-help-in-resizing/286839 "2009-04-21T20:18:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![diegobydesign](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@diegobydesign](https://forum.kirupa.com/u/diegobydesign)
#### Post date: [April 21, 2009, 8:18pm UTC](https://forum.kirupa.com/t/gallery-slideshow-issues-need-help-in-resizing/286839/1 "2009-04-21T20:18:27Z")

</div>

My code below, I was able to tweak from a friend. I wanted to create a dynamic image library that is easily updated from an outside folder. Though the problem is the images cover the whole stage. I can seem to figure out how change it so that the images appear at a specific location and specific size.

Highlighted in red is where I tweaked the code. Please Help, I really could use the knowledge.

Thanks in advance.

[SIZE=“1”]import fl.transitions._;  
import fl.transitions.easing._;  
////////////////////////////////////////////////////////////////////////  
// Variables Initiation and Declaration  
////////////////////////////////////////////////////////////////////////  
var pic\_prev\_mc:MovieClip=new MovieClip();  
var pic\_mc:MovieClip=new MovieClip();  
var picInitial\_mc:MovieClip=new MovieClip();  
var xmlLoader:URLLoader = new URLLoader();  
var xmlData:XML;  
var thumbLoader:Loader;  
var index:int=0;  
var picArray:Array=new Array();  
var timer :Timer=new Timer(3000,4);  
var curr:int=1;  
var totalPictures:int;  
var flag:int=0;  
var bitmap:DisplayObject;  
var effect:Object=Photo;  
////////////////////////////////////////////////////////////////////////  
// Function XMl Loading  
////////////////////////////////////////////////////////////////////////  
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);  
var httpHeader : URLRequestHeader = new URLRequestHeader(“pragma”,“no-cache”);  
var path:String=“Banner.xml”;  
xmlLoader.load(new URLRequest(path));

[COLOR=“Red”]function LoadXML(e:Event):void {  
xmlData = new XML(e.target.data);  
stage.scaleMode = StageScaleMode.NO\_BORDER;  
stage.stageWidth=xmlData.Width;  
stage.stageHeight=xmlData.Height;  
getValues(xmlData);[/COLOR]

}// end of Load XML  
xmlLoader.addEventListener(IOErrorEvent.IO\_ERROR,funcError);  
function funcError(event:IOErrorEvent){  
trace(“Error occured in XML Loading”);  
}  
function getValues(input:XML) {  
var xmlCategoryList:XMLList = input.children();  
totalPictures=input.children().length();  
var item:XML;  
for each (item in xmlCategoryList) {

```
	loadThumbs();
}

```

}  
////////////////////////////////////////////////////////////////////////  
// Function loadThumbs  
////////////////////////////////////////////////////////////////////////  
function loadThumbs():void {  
thumbLoader = new Loader();  
thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadThumbProgress);  
thumbLoader.contentLoaderInfo.addEventListener(Event.INIT, thumbLoaded);  
thumbLoader.load(new URLRequest(String(xmlData.path[index])));//access the thumbnails

```
function loadThumbProgress(e:ProgressEvent):void {
}
////////////////////////////////////////////////////////////////////////
// Function thumbloaded
////////////////////////////////////////////////////////////////////////
function thumbLoaded(e:Event):void {
	for(var i:int=0;i&lt;totalPictures;i++){;
	picArray*=xmlData.path*;

}
addChild(picInitial_mc);
picInitial_mc.addChild(thumbLoader.content);
bitmap=thumbLoader.content;

```

}  
function xmlLoadFail(event:IOErrorEvent):void {  
trace(“error loading the XML”);  
}  
}  
////////////////////////////////////////////////////////////////////////  
// Function Next Pic Loading  
////////////////////////////////////////////////////////////////////////  
function nextPicLoad(string:String) {  
thumbLoader = new Loader();  
thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadThumbProgress);  
thumbLoader.contentLoaderInfo.addEventListener(Event.INIT, thumbLoaded);  
thumbLoader.load(new URLRequest(String(string)));

function thumbLoaded(e:Event):void {  
stage.addChild(thumbLoader.content);  
addChild(pic\_mc);  
addChild(thumbLoader.content);  
pic\_mc.addChild(thumbLoader.content);  
bitmap=thumbLoader.content;  
//Blinds, Fade, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, or Zoom.  
TransitionManager.start(pic\_mc,{type:Wipe,direction:Transition.IN,duration:3,easing:Strong.easeIn});  
TransitionManager.start(pic\_mc,{type:Fade,direction:Transition.IN, duration:3, easing:Strong.easeIn});

```
}

```

function loadThumbProgress(e:ProgressEvent):void {  
}

}

////////////////////////////////////////////////////////////////////////  
// Function Pic Display  
////////////////////////////////////////////////////////////////////////

function picDisplay() {  
timer.start();  
timer.addEventListener(TimerEvent.TIMER\_COMPLETE,funcTimer);  
function funcTimer(event:TimerEvent) {  
for(var k:int=0;k\<pic\_mc.numChildren;k++){  
pic\_mc.removeChildAt(k);

```
}
if (flag==0) {
	flag=1;
	removeChild(picInitial_mc);
} else {
	removeChild(pic_mc);
	}
addChild(bitmap)
nextPicLoad(picArray[curr]);
curr++;

if (curr==totalPictures) {
	curr=0;
}
timer.reset();
timer.start();

```

}  
}  
picDisplay();  
stop();  
[/SIZE]
