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;
}
};
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;
}
};