OK no one answered my question…which is kinda good I guess cuz it made me puzzle it out. N E way, I am trying to get this dang photogallery to load into another movie. so I use _root.contents.loadMovie(“portfolio.swf”); and it should load right? I don’t know. All my other swf’s loaded fine, just not this one. one pic shows up, and that’s it. No forward or back buttons, nothing. why would only one pic show up, and not have buttons? I open the swf, and everything is fine. It’s just not loading into my movie clip (contents). Could someone PLEEEZE help me???
Thanks to everyone that has helped…you have been awesome.
Here is the code for my folio that I got off the tut. Do any of the variables need to be changed in order to allow for dynamic loading?
// Code written by sbeener (suprabeener)
//
// i wrote this code, but you can use and abuse it however you like.
// the methods are defined in the order which they occur to make it
// easier to understand.
//
// 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 = “pics/”;
// fill this array with your pics
this.pArray = [“ad1.jpg”, “ad2.jpg”, “ad3.jpg”, “ad4.jpg”, “ad5.jpg”, “ad6.jpg”, “ad7.jpg”, “ad8.jpg”, “ad9.jpg”, “ad10.jpg”, “ad11.jpg”, “ad12.jpg”, “ad13.jpg”, “ad14.jpg”, “ad15.jpg”, “hand1.jpg”, “hand2.jpg”, “hand3.jpg”, “hand4.jpg”, “hand5.jpg”, “hand6.jpg”, “hand7.jpg”, “hand8.jpg”, “hand9.jpg”, “hand10.jpg”, “hand11.jpg”, “hand12.jpg”, “hand13.jpg”, “hand14.jpg”, “id1.jpg”, “id2.jpg”, “id3.jpg”, “id4.jpg”, “id5.jpg”, “id6.jpg”, “id7.jpg”, “id8.jpg”, “id9.jpg”, “id10.jpg”, “photo1.jpg”, “photo2.jpg”, “photo3.jpg”, “photo4.jpg”, “photo5.jpg”, “photo6.jpg”, “photo7.jpg”, “photo8.jpg”, “photo9.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);