Hey i tried the photogallery tutorial and when i published it there was no picture in the frame heres the actionscript, did i make any errors?
[AS]// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. “pics/”)
// leave it blank if they’re in the same directory
this.pathToPics = “http://www.thozeguys.com/pics/”;
// fill this array with your pics
this.pArray = [“DSCF0019.JPG”, “DSCF0022.JPG”, “DSCF0027.JPG”, “DSCF0028.JPG”, “DSCF0029.JPG”, “DSCF0031.JPG”, “DSCF0033.JPG”, “DSCF0035.JPG”, “DSCF0038.JPG”, “DSCF0049.JPG”, “DSCF0042.JPG”, “DSCF0052.JPG”, “DSCF0053.JPG”, “DSCF0055.JPG”, “DSCF0057.JPG”, “DSCF0062.JPG”, “DSCF0068.JPG”, “DSCF0070.JPG”, “DSCF0071.JPG”];
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], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
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() {
// specify the movieclip to load images into
var p = _root.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;
}
};
// Actions -----------------------------------------
// these aren’t necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);[/AS]
Hey ernie, welcome to kirupa forum. =)
The first thing I can think of is, make sure that your images are non-progressive JPEG’s. :-
http://www.macromedia.com/support/flash/ts/documents/cant_load_jpg.htm
And next time, please use [AS][/AS] tags to show your code. Thank you.
ahh thanks, whats a good editing program to make them non-progressive?
I’d use Photoshop or Fireworks, any program should do though.
thanks!
No problem. =)
I just tried saving as… for one of the pictures in photoshop and theres no progressive option you have any idea where it would say something about it?
If you are using photoshop6, click File | Save for Web
then uncheck the “Progressive” option and hit ok.
heres one of the pictures.
i finally found the option!! yay!
sad news… It still wont work i put it on the internet so yuo can see for yourself
http://www.thozeguys.com/APG.html
Can we see the FLA ?
here it is
what do ya think?
here i changed the code try this new .fla file
My idiotic self would use gotoandStop for photo gallerys! :sigh:
Yes, thats what I did with my gallery on my site, but it quickly got really big sucking up lots of bandwidth, so I am trying to make a dyanmic gallery too.
how do you do that?
Just take the pics, put em on seperate keyframes, add buttons…and ur done.