Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oh help~ preloader confusion

Status
Not open for further replies.

dzr

Programmer
Nov 20, 2001
109
US
I already posted this but I'm not sure it was conherent enough to answer...

I have a flash slide show that uses loadMovie to dynamically load the pictures from an external directory.
I have made this file into an exe and burned it onto a disk with and auto-run.

All works great except it has to go to the cd everytime the pic changes... I want to try to cache these images so it doesnt keep running the cd.

Since the swf is done I was thinking I could just build a seperate movie, preload the images, then call the other movie... (the whole thing is in frame one.. all preloader tutorials say to put the preloader there)

Arrgghh.. I'm confused but I don't know how to explain it...

It already pre-loads in a way -- one image fades out as the new one loads in.

This is the code --

this.pathToPics = "images/";

this.pArray = ["welcome.jpg", "pic1.jpg", "pic2.jpg", ...];
this.fadeSpeed = 20;
this.pIndex = 0;

loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
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() {
var p = _root.photo; //movie clip it's being loaded into
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;
}
};
 
If the projector and all the pictures are on the cd, it seems normal that it would go to the cd, as it would go to one of your drives, if the pictures were on that drive.
Unless you install the whole thing on one of the drives of the system (like installing a game or an application), then it will allways go back to the cd.

Regards,

cubalibre2.gif
 
I kind of had the feeling that was the answer. The load time is not the problem - it's zippy transition to new pic...

Thanks for the input...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top