# Simple Script Question

**URL:** https://forum.kirupa.com/t/simple-script-question/293670
**Category:** flash
**Created:** [August 1, 2009, 6:37am UTC](https://forum.kirupa.com/t/simple-script-question/293670 "2009-08-01T06:37:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Gmoney34](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@Gmoney34](https://forum.kirupa.com/u/Gmoney34)
#### Post date: [August 1, 2009, 6:37am UTC](https://forum.kirupa.com/t/simple-script-question/293670/1 "2009-08-01T06:37:55Z")

</div>

I downloaded the example for the following site:  
[[COLOR=#336699]http://www.webzo.org/tutorials/flash…-slideshow.php[/COLOR]](http://www.webzo.org/tutorials/flash/xml-random-image-slideshow.php)  
It allows you dow add images to the .xml file and then it show the images in a flash. Basically a slide show, but I have one problem the images have to be preset to the following side of the document its self. So I added the following code so the images can re size:

Can This be converted over to ActionScript 2?

import flash.display.StageScaleMode;  
import flash.display.StageAlign;  
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO\_SCALE;  
stage.align = StageAlign.TOP\_LEFT;  
stage.addEventListener (Event.RESIZE, resizeHandler);

// initialize sizing  
resizeHandler (null);

function resizeHandler (event:Event):void {  
var sw:Number = stage.stageWidth;  
var sh:Number = stage.stageHeight;  
picture\_mc.width = sw;  
picture\_mc.height = sh-header\_mc.height;  
}  
function randomImage() {  
if (loaded == filesize) {  
var ran = Math.round(Math.random() \* (totalImages - 1));  
picture\_mc.loadMovie(imageFileName[ran], 1);  
pause();  
}  
}
