# Slideshow array, root problem

**URL:** <https://forum.kirupa.com/t/slideshow-array-root-problem/59587>\
**Category:** Uncategorized\
**Created:** [August 2, 2004, 7:57am UTC](https://forum.kirupa.com/t/slideshow-array-root-problem/59587 "2004-08-02T07:57:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashwillkill](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@flashwillkill](https://forum.kirupa.com/u/flashwillkill)\
**Post date:** [August 2, 2004, 7:57am UTC](https://forum.kirupa.com/t/slideshow-array-root-problem/59587/1 "2004-08-02T07:57:21Z")

</div>

hi everyone,  
somewhere in the forum i found this slideshow:  
[http://actionscript-toolbox.com/samplemx\_slideshow.php](http://actionscript-toolbox.com/samplemx_slideshow.php)

the script reads:  
var pic\_arr = [“image01.swf”, “image02.swf”, “image03.swf”, “image04.swf”,  
“image05.swf”];  
var color\_arr = [0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff];  
var currentSlide = 0;

// specify pic locations, alpha increment each frame, and  
// number of frames to keep current picture displayed before  
// transitioning to the next one

this.attachMovie(“slideshow”, “show”, 1, {  
\_x:0, \_y:0, \_visible:false, fps:40, nFrames:100, alphaIncr:30,  
slides\_arr:pic\_arr, slideDepth:1, repeat:true,  
slideTracker:“currentSlide”});

// tell \_root (this) to listen for events broadcast by show  
show.addListener(this);

this.onSlideLoaded = function(i) {  
(new Color(this[“dot”+i+"\_mc"])).setRGB(color\_arr\*);  
// trace('slide ‘+ i + ’ loaded’);  
};

this.onAllSlidesLoaded = function() {  
show.\_visible = true;  
show.beginTransitions();  
};

my problem is, that i load the slideshow into a mc. that works. yet it is trying to load the pics from the main directory and for some reason i cant figure out how to add the specify pic location (the pathToPics) into this script. slideshow.swf and the pics are in the same folder, so why does’nt this work???  
could anyone please help?  
thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 2, 2004, 1:22pm UTC](https://forum.kirupa.com/t/slideshow-array-root-problem/59587/2 "2004-08-02T13:22:23Z")

</div>

It’s probably in there:

```auto
var pathToPic = "" ; // you'll have to fill that
Slideshow.prototype.loadInSeq = function(i) {
    var slide = this.createEmptyMovieClip("slide" + i, this.slideDepth++);
    // hide all slides loading on top of first one
    if (i > 0) slide._alpha = 0;
    slide.loadMovie(pathToPic + this.slides_arr*);
    checkLoadedID = setInterval(function(i, mc) {
        if (mc["slide" + i]._width > 0) {
            mc.broadcastMessage("onSlideLoaded", i);
            clearInterval(checkLoadedID);
            // start next one loading (if not last)
            if (i < mc.slides_arr.length-1) {
                mc.loadInSeq(i + 1);
            } else {
                mc.broadcastMessage("onAllSlidesLoaded");
            }	
        }
        }, 1000/this.fps, i, this);
};

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 2, 2004, 6:20pm UTC](https://forum.kirupa.com/t/slideshow-array-root-problem/59587/3 "2004-08-02T18:20:15Z")

</div>

hi ilyas,  
thanks for reply. well, the component, didn’t think of that.  
got really happy … but now i am still pulling my hair.

i tried everything i could come up with:  
var pathToPic = “./folder1/folder2/folder3/”;  
var pathToPic = “/folder1/folder2/folder3/”;  
var pathToPic = “folder1/folder2/folder3/”;  
to explain … my main directory has a folder, in it another and yet another with the images and the slideshow …

and i even left it blank as i thought they are in the same directory???  
var pathToPic = “” ;

…%§&/(&(/&??? i always get the output message:  
Error opening URL “file:///D|/%5FmySite/flash/image01.swf”

apparently it always looks in the main directory. why is this???  
is there a trick? at this point i’ll take any advice.  
thanks
