I’m having an issue and was wondering if someone can help. On my site I have all the external swf files loading in to the content movie. It works great, however the media page uses the Photo Gallery Tut (http://www.kirupa.com/developer/mx/photogallery.htm) now, the only problem is that the medai page dosen’t display correctly. Im guessing that since the media page is loading in the _root.content then the code for medai says to load in _root.photo it is confusing the main swf file. Please advise…here is the conde snippets:
The questionable code is in Bold, and HUGE.
[size=3]Media File:[/size]
//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 = “animation/”;
// fill this array with your pics
this.pArray = [“slideshow1.jpg”, “slideshow2.jpg”, “slideshow3.jpg”, “slideshow4.jpg”, “slideshow5.jpg”, “slideshow6.jpg”, “slideshow7.jpg”, “slideshow8.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
[size=4][color=black]loadMovie(this.pathToPics+this.pArray[0], _root.photo);
[/color][/size]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
[size=4]var p = _root.photo;
[/size]//------------------------------------------
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);
[size=3]Main SWF File:[/size]
button_7.onRelease = function() {
if (_root.section != “media.swf”) {
_root.section = “media.swf”;
_root.transition.gotoAndPlay(“closing”);
}
};
Thanks!
Andrew