# Embedding a Flash photo slideshow

**URL:** <https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915>\
**Category:** Uncategorized\
**Created:** [June 1, 2004, 4:44pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915 "2004-06-01T16:44:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteadyScene](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SteadyScene](https://forum.kirupa.com/u/SteadyScene)\
**Post date:** [June 1, 2004, 4:44pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/1 "2004-06-01T16:44:00Z")

</div>

Browsing around the forums I saw bits and peices of what I want to accomplish, but not quite.

I need to create a flash photo slidshow that is 129 x 174 (this is the size of the splice from the webpage) and embed it into my html site.

Requirements:

- externally load jpg’s that reside on the server - RANDOMLY
- jpgs must be easily added, changed (edited in notepad for end user)
- no buttons required
- jpgs must fade in every 15 seconds or so

Has anyone seen this? If so, I would need some assistance and the code.

Regards,

Daniel

---

<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:** [July 5, 2004, 5:26pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/2 "2004-07-05T17:26:35Z")

</div>

Scotty,  
Sorry to trouble you again. But I’m having a bit of a problem. Since last time you helped me out I decided that rather than the pictures loading randomly i wanted them in sequence. So using the loading the array contents from the text file from your code and some other code from somewhere else in the forum, i came up with this.  
My problem is that it doesnt show the first picture and says “error opening URL” then continues fine and even includes the first picture when it has gone through once. I’m guessing i have either got your text file loading bit in the wrong place or need to include something else (I am sure it I am making a basic mistake)  
I have tried hard to work it out and now am stumped. My knowledge is improving but is still limited.  
Here is the code i’m using:

(I hope i’ve put the tags in correctly)

```auto
this.pathToPics = "images/";
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], this.photo);
MovieClip.prototype.changePhoto = function(d) 
{
 
  this.pIndex = Math.min(Math.max(0, this.pIndex), this.pArray.length);
  this.pIndex++;
 
 
 if (this.pIndex>=this.pArray.length) 
  {
  this.pIndex = 0;
 }
  this.onEnterFrame = fadeOut;
  
  
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = this.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() 
{
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// load your textfile
myLV = new LoadVars();
myLV.onLoad = function() {
    pArray = this.photoId.split(",");
};
myLV.load("photo.txt");
setInterval(this, "changePhoto", 3000, 1);

```

Your help is really appreciated.

Xof.

---

<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:** [July 7, 2004, 9:19am UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/3 "2004-07-07T09:19:02Z")

</div>

thank you for your time!!!:pleased:

xof

---

<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:** [July 7, 2004, 11:53am UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/4 "2004-07-07T11:53:45Z")

</div>

My bad:stunned:  
Change the waitamoment function in:

```auto
function waitamoment() {
	photo.loadMovie(this.pathToPics+pArray[0]);
	clearInterval(id);
}

```

And it will work:)  
btw I couldn’t open your sequence array fla?

scotty(-:

---

<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:** [July 7, 2004, 2:32pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/5 "2004-07-07T14:32:03Z")

</div>

thanks scotty, it working now except that it still isnt finding the first picture. It reports Error opening URL “file:///E|/qemain/0” ie not including pathToPics or image0.jpg. I tried to waitamoment longer but still has trouble.

seq array fla is pretty much the same as the other without your text loading bit. It still opens for me fine.

Thank you.  
Xof

---

<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:** [July 7, 2004, 5:21pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/6 "2004-07-07T17:21:13Z")

</div>

Xof, sorry, sorry, sorry :snooze:  
This is the correct code [size=1](this time tested with pictures[/size]

```auto
function waitamoment() {
        photo.loadMovie(pathToPics+pArray[0]);//removed the "this" in pathToPics
        clearInterval(id);
}

```

scotty(-:

---

<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:** [July 7, 2004, 7:21pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/7 "2004-07-07T19:21:06Z")

</div>

also make sure the file names are lower case (jpg). Alot of thumbnail programs capitalize the extensions (JPG).

---

<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:** [July 7, 2004, 8:22pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/8 "2004-07-07T20:22:04Z")

</div>

thanks scotty,  
I really appreciate all your help! 🍺 and your patience!!

(steadyscene: thanks for the heads-up!)

xof

---

<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:** [July 7, 2004, 9:45pm UTC](https://forum.kirupa.com/t/embedding-a-flash-photo-slideshow/111915/9 "2004-07-07T21:45:56Z")

</div>

welcome:)
