# Slide show image order

**URL:** <https://forum.kirupa.com/t/slide-show-image-order/325580>\
**Category:** Uncategorized\
**Created:** [October 24, 2011, 4:50pm UTC](https://forum.kirupa.com/t/slide-show-image-order/325580 "2011-10-24T16:50:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![designatplay](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@designatplay](https://forum.kirupa.com/u/designatplay)\
**Post date:** [October 24, 2011, 4:50pm UTC](https://forum.kirupa.com/t/slide-show-image-order/325580/1 "2011-10-24T16:50:35Z")

</div>

\*\*Hello, I purchased a Flash actionscript2 image slide show which changes the order of the images every time the browser is refreshed. I’m wondering if someone can help alter the following script to stop the “random” order of images. Im also attcahing the .fla file if that’s more helpful.

Thanks for your help!\*\*

import flash.filters.DropShadowFilter;  
BarHeight=160;  
BarHeightOver=170;  
BarWidth=900;  
Spacing=20;  
alpha=100;  
barColor=“0xFFFFFF”;  
borderColor=“0xFFFFFF”;  
borderColorOnOver=“0xFFFFFF”;  
borderSize=0;  
barBorder=0;  
background=false;  
efect=3;  
WidthSpacing=50;  
var textFormat:TextFormat = new TextFormat();  
textFormat.bold=false;  
textFormat.font=“arial”;  
textFormat.size=1;  
textFormat.color=0xFFFFFF;

xml=new XML();  
xml.ignoreWhite=true;  
xml.load(“scroll.xml”); // Set the xml file  
xml.onLoad = function(ok)  
{  
if (ok)  
create\_scroll();  
}

openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {

getURL (“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open(’” + url + “’,’” + winName + “’,’” + “width=” + w + “,height=” + h + “,toolbar=” + toolbar + “,location=” + location + “,directories=” + directories + “,status=” + status + “,menubar=” + menubar + “,scrollbars=” + scrollbars + “,resizable=” + resizable + “,top=’+((screen.height/2)-(” + h/2 + “))+’,left=’+((screen.width/2)-(” + w/2 + “))+’” + “’)}else{myWin.focus();};void(0);”);  
};

create\_scroll =function(){

this.createTextField(“test”,this.getNextHighestDepth(),0,0,0,0);  
test.autoSize=“center”;  
test.text=“home”;  
test.setTextFormat(textFormat);  
testHeight=test.\_height;  
test.text="";

this.createEmptyMovieClip(“scroll”,this.getNextHighestDepth());  
scroll.\_x=(Stage.width-BarWidth)/2;  
scroll.\_y=(Stage.height-BarHeightOver)/2;  
scroll.createEmptyMovieClip(“barBackground”,scroll.getNextHighestDepth());  
with(scroll.barBackground){  
beginFill(barColor,100);  
lineTo(BarWidth,0);  
lineTo(BarWidth,BarHeightOver+(2_barBorder));  
lineTo(0,BarHeightOver+(2_barBorder));  
lineTo(0,0);  
}

scroll.createEmptyMovieClip(“bar”,scroll.getNextHighestDepth());

scroll.createEmptyMovieClip(“barMask”,scroll.getNextHighestDepth());  
with(scroll.barMask){  
beginFill(0x000000,100);  
lineTo(BarWidth,0);  
lineTo(BarWidth,BarHeightOver+(2_barBorder)+testHeight);  
lineTo(0,BarHeightOver+(2_barBorder)+testHeight);  
lineTo(0,0);  
}

scroll.bar.setMask(scroll.barMask);  
var dsfInstanceLeft:DropShadowFilter = new DropShadowFilter(0, 0,  
barColor, 0, 0, 0);  
var dsfInstanceRight:DropShadowFilter = new DropShadowFilter(0, 0,  
barColor, 0, 0, 0);

scroll.createEmptyMovieClip(“blurLeft”,scroll.getNextHighestDepth());  
with(scroll.blurLeft){  
beginFill(barColor,100);  
lineTo(20,0);  
lineTo(20,BarHeightOver+(2_barBorder));  
lineTo(0,BarHeightOver+(2_barBorder));  
lineTo(0,0);  
\_x=-20;  
filters=[dsfInstanceLeft];  
}  
scroll.createEmptyMovieClip(“blurRight”,scroll.getNextHighestDepth());  
with(scroll.blurRight){  
beginFill(barColor,100);  
lineTo(20,0);  
lineTo(20,BarHeightOver+(2_barBorder));  
lineTo(0,BarHeightOver+(2_barBorder));  
lineTo(0,0);  
\_x=scroll.bar.\_x+BarWidth;  
filters=[dsfInstanceRight];  
}

width=WidthSpacing;  
var pic:Object = new Object();  
pic.onLoadInit = function(target:MovieClip){  
target.forceSmoothing = true;  
while (target.\_height\>BarHeight-2_borderSize){  
target.\_height-=target.\_height/100;  
target.\_width-=target.\_width/100;  
}  
target.\_x=width+borderSize;  
target.\_y=borderSize+barBorder+(BarHeightOver-BarHeight)/2;  
target.width=target.\_width;  
target.height=target.\_height;  
target.load=true;  
target.\_alpha=alpha;  
width+=(target.\_width+Spacing+(2_borderSize));  
for (j=0;j\<xml.firstChild.childNodes.length;j++){  
if (target==scroll.bar[“picture”+j].pic){  
scroll.bar[“picture”+j].y=scroll.bar[“picture”+j].\_y;  
scroll.bar[“picture”+j].x=scroll.bar[“picture”+j].\_x;  
if (background){  
with(scroll.bar[“picture”+j].background){  
beginFill(0x666666,100);  
lineTo(target.\_width+2_borderSize,0);  
lineTo(target.\_width+2_borderSize,target.\_height+2_borderSize);  
lineTo(0,target.\_height+2_borderSize);  
lineTo(0,0);  
\_x=target.\_x-borderSize;  
\_y=target.\_y-borderSize;  
}  
}  
scroll.bar[“picture”+j].onRollOver = function(){  
this.caption=true;  
}  
scroll.bar[“picture”+j].onRollOut = function(){  
this.caption=false;  
scroll.info.text="";  
}  
scroll.bar[“picture”+j].onRelease = function(){  
for (k=0;k\<xml.firstChild.childNodes.length;k++)  
if (this==scroll.bar[“picture”+k]){  
openWinCentre(xml.firstChild.childNodes[k].attributes.address, xml.firstChild.childNodes[k].attributes.target\_winName, int(xml.firstChild.childNodes[k].attributes.width), int(xml.firstChild.childNodes[k].attributes.height), int(xml.firstChild.childNodes[k].attributes.toolbar), int(xml.firstChild.childNodes[k].attributes.location), int(xml.firstChild.childNodes[k].attributes.directories), int(xml.firstChild.childNodes[k].attributes.status), int(xml.firstChild.childNodes[k].attributes.menubar), int(xml.firstChild.childNodes[k].attributes.scrollbars), int(xml.firstChild.childNodes[k].attributes.resizable));  
[//this.getURL](https://this.getURL)(xml.firstChild.childNodes[k].attributes.link,xml.firstChild.childNodes[k].attributes.target);  
}  
}

```
        }
    }
    
}

```

var imag:MovieClipLoader = new MovieClipLoader();  
imag.addListener(pic);  
for (i=0;i\<xml.firstChild.childNodes.length;i++){  
scroll.bar.createEmptyMovieClip(“picture”+i,i);  
scroll.bar[“picture”+i].createEmptyMovieClip(“background”,scroll.bar[“picture”+i].getNextHighestDepth());  
scroll.bar[“picture”+i].createEmptyMovieClip(“pic”,scroll.bar[“picture”+i].getNextHighestDepth());  
imag.loadClip(xml.firstChild.childNodes\*.attributes.url,scroll.bar[“picture”+i].pic);  
}  
scroll.createTextField(“info”,scroll.getNextHighestDepth(),0,BarHeightOver+barBorder\*2,0,0);  
scroll.info.autoSize=“center”;

scroll.barMask.onEnterFrame=function(){  
for (i=0;i\<xml.firstChild.childNodes.length;i++){  
if (scroll.bar[“picture”+i].caption){  
scroll.textBar.info.text=xml.firstChild.childNodes\*.attributes.title;  
scroll.textBar.info.setTextFormat(textFormat);  
scroll.bar[“picture”+i].pic.\_alpha=100;  
scroll.info.text=xml.firstChild.childNodes\*.attributes.title;  
scroll.info.setTextFormat(textFormat);  
if (background)  
scroll.info.\_x=scroll.bar[“picture”+i].background.\_x+scroll.bar.\_x;  
else  
scroll.info.\_x=scroll.bar[“picture”+i].pic.\_x+scroll.bar.\_x+(scroll.bar[“picture”+i].pic.\_width-scroll.info.\_width)/4;  
var color:Color = new Color(scroll.bar[“picture”+i].background);  
color.setRGB(borderColorOnOver);  
if (efect==1)  
scroll.bar[“picture”+i].\_y=5;  
if (efect==2)  
scroll.bar[“picture”+i].\_y=-5;  
if ((efect==3)&&(scroll.bar[“picture”+i].\_height\<BarHeightOver)){  
scroll.bar[“picture”+i].swapDepths(xml.firstChild.childNodes.length)  
scroll.bar[“picture”+i].pic.\_height+=5_scroll.bar[“picture”+i].pic.\_height/100;  
scroll.bar[“picture”+i].pic.\_width+=5_scroll.bar[“picture”+i].pic.\_width/100;  
scroll.bar[“picture”+i].\_y-=5_scroll.bar[“picture”+i].\_height/200;  
scroll.bar[“picture”+i].\_x-=5_scroll.bar[“picture”+i].\_width/200;  
scroll.bar[“picture”+i].background.\_width=scroll.bar[“picture”+i].pic.\_width+(2_borderSize);  
scroll.bar[“picture”+i].background.\_height=scroll.bar[“picture”+i].pic.\_height+(2_borderSize);

```
         }
    }
    else{
        var color:Color = new Color(scroll.bar["picture"+i].background);
                color.setRGB(borderColor); 
        scroll.bar["picture"+i].pic._alpha=alpha;
        if ((efect==1)or(efect==2))
        scroll.bar["picture"+i]._y=0;
        if ((efect==3)&&(scroll.bar["picture"+i].background._height&gt;BarHeight)&&(background)){
            scroll.bar["picture"+i].swapDepths(i);
            scroll.bar["picture"+i].pic._height-=5*scroll.bar["picture"+i].pic._height/100;
            scroll.bar["picture"+i].pic._width-=5*scroll.bar["picture"+i].pic._width/100;
            scroll.bar["picture"+i]._x+=5*scroll.bar["picture"+i].pic._height/200;
            scroll.bar["picture"+i]._y+=5*scroll.bar["picture"+i].pic._width/200;
            scroll.bar["picture"+i].background._height=scroll.bar["picture"+i].pic._height+(2*borderSize);
            scroll.bar["picture"+i].background._width=scroll.bar["picture"+i].pic._width+(2*borderSize);
            if (scroll.bar["picture"+i]._height&lt;=BarHeight){
                scroll.bar["picture"+i].pic._width=scroll.bar["picture"+i].pic.width;
                scroll.bar["picture"+i].pic._height=scroll.bar["picture"+i].pic.height;
                scroll.bar["picture"+i]._x=scroll.bar["picture"+i].x;
                scroll.bar["picture"+i]._y=scroll.bar["picture"+i].y;
                scroll.bar["picture"+i].background._height=scroll.bar["picture"+i].pic._height+(2*borderSize);
                scroll.bar["picture"+i].background._width=scroll.bar["picture"+i].pic._width+(2*borderSize);
            }
         }
         if ((efect==3)&&(scroll.bar["picture"+i]._height&gt;BarHeight)&&(background!=true)){
            scroll.bar["picture"+i].swapDepths(i);
            scroll.bar["picture"+i].pic._height-=5*scroll.bar["picture"+i].pic._height/100;
            scroll.bar["picture"+i]._y+=5*scroll.bar["picture"+i].pic._width/200;
            scroll.bar["picture"+i].pic._width-=5*scroll.bar["picture"+i].pic._width/100;
            scroll.bar["picture"+i]._x+=5*scroll.bar["picture"+i].pic._height/200;
            if (scroll.bar["picture"+i]._height&lt;=BarHeight){
                scroll.bar["picture"+i].pic._width=scroll.bar["picture"+i].pic.width;
                scroll.bar["picture"+i].pic._height=scroll.bar["picture"+i].pic.height;
                scroll.bar["picture"+i]._x=scroll.bar["picture"+i].x;
                scroll.bar["picture"+i]._y=scroll.bar["picture"+i].y;
            }
         }
    }
}

```

firstWidth=scroll.bar[“picture”+0].\_width;  
lastWidth=scroll.bar[“picture”+(xml.firstChild.childNodes.length-1)].\_width;

if ((this.\_ymouse\>0)&&(this.\_ymouse\<BarHeightOver)&&(this.\_xmouse\>=0)&&(this.\_xmouse\<=BarWidth)){  
xmouse=this.\_xmouse;  
}

```
    if (((xmouse-firstWidth)&gt;0)&&((xmouse+lastWidth)&lt;BarWidth)){
    scroll.bar._x-=(Math.abs((((width+WidthSpacing)-BarWidth)/BarWidth)*(xmouse-lastWidth+(firstWidth+lastWidth)*(xmouse/(BarWidth-lastWidth))))-Math.abs(scroll.bar._x-this._x))/10;
    }
    if ((xmouse-firstWidth)&lt;0){
     if (scroll.bar._x&lt;this._x)
       scroll.bar._x+=(Math.abs(scroll.bar._x)+this._x)/10;
    }
    if ((xmouse+lastWidth)&gt;BarWidth){
        if (scroll.bar._x&gt;-((width+WidthSpacing)-BarWidth-this._x))
         scroll.bar._x-=(((width+WidthSpacing)-BarWidth-this._x)+scroll.bar._x)/10;
    }

```

}

}
