Hi
I have made an gallery that loads external swf files using the original kirupa image gallery tutorial and the fixed tutorial in the forums to center my swf files. Here is my code:
// variables ------------------------------------------
fscommand(“fullscreen”, “true”);
// put the path to your pics here, include the slashes (ie. “pics/”)
// leave it blank if they’re in the same directory
this.pathToPics = “swf/”;
// fill this array with your pics (set from filearray.php)
this.pArray = [“001.swf”, “005.swf”, “065.swf”];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
MovieClip.prototype.centered = function(x, y) {
this._x = x-this._width/2;
this._y = y-this._height/2;
};
// loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.smlEmpty);
// Center the photo at (x,y) the coordinates are set in line 69
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.smlEmpty._alpha>this.fadeSpeed) {
this.smlEmpty._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.smlEmpty;
// ------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.smlEmpty.getBytesLoaded();
t = this.SmlEmpty.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
// This line sets the (x,y) center of the image on the stage
this.smlEmpty.centered(512, 320);
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.smlEmpty._alpha<100-this.fadeSpeed) {
this.smlEmpty._alpha += this.fadeSpeed;
} else {
this.smlEmpty._alpha = 100;
this.onEnterFrame = null;
}
};
… now what i want to do is to be able to horizontally scroll swfs that are bigger than the clip they are loaded into.
I have searched extensively but cannot find an answer here, can anyone help? If you can can you tell me where to place the code?
Thanks
Camo :d: