Hi, I’m creating a gallery using the following code, but it’s been so long since I last used it I can’t remember what the thumbnails and larger pics are supposed to be titled - I assume the first person who looks at this will be able to tell me:bored:. Also, where do you think the images should be placed? I’d have automatically placed them in the library, but in the gallery I created before, they’re not placed in the library:puzzle:.
Anyway… (and thanks in advance)
image_arr = new Array();
maxImages = 8;
for (var i = 0 ; i < maxImages ; i++)
{
image_arr.push("image" + i);
}
currentHolder = 0;
theDepth = 1000;
topY = 65;
_global.imageLoaded = false;
_global.selectedImage = 0;
this.createEmptyMovieClip("thumb_mc", theDepth++ + 10000);
this.createEmptyMovieClip("img0_mc", theDepth++ + 10000);
this.createEmptyMovieClip("img1_mc", theDepth++ + 10000);
this.attachMovie("FScrollPaneSymbol", "thumb_sp", 1000, {_x:25, _y:375});
this.thumb_sp.setSize(1000);
this.thumb_sp.boundingBox_mc._alpha = 0;
this.thumb_sp.setStyleProperty("arrow", 0x88BBFF);
this.thumb_sp.setStyleProperty("scrollTrack", 0x88BBFF);
this.thumb_sp.setStyleProperty("face", 0xFFFFFF);
for (var i = 0; i < image_arr.length; i++)
{
this.thumb_mc.createEmptyMovieClip("thumb" + i + "_mc", theDepth++);
this.thumb_mc.createEmptyMovieClip("thumb" + i + "_tmp_mc", theDepth++);
this.thumb_mc["thumb" + i + "_mc"]._x = 25 + 175 * i;
this.thumb_mc["thumb" + i + "_mc"]._y = 375;
this.thumb_mc["thumb" + i + "_mc"].loadMovie(image_arr* + "_tn.jpg");
this.thumb_mc["thumb" + i + "_tmp_mc"].no = i;
this.thumb_mc["thumb" + i + "_tmp_mc"].onEnterFrame = function()
{
var _mc = this._parent["thumb" + this.no + "_mc"];
var l = _mc.getBytesLoaded();
var t = _mc.getBytesTotal();
if ((l >= t) && (t > 1) && (_mc._width > 1))
{
_mc.num = this.no;
_mc.onPress = function()
{
if ((_global.selectedImage != this.num) && (_global.imageLoaded))
{
loadImage(this.num);
}
};
this._parent._parent.thumb_sp.setScrollContent(this._parent);
this._parent._parent.thumb_sp.refreshPane();
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function loadImage(num)
{
_global.imageLoaded = false;
this["img" + currentHolder + "_mc"]._x = 25;
this["img" + currentHolder + "_mc"]._y = 1000;
this.createEmptyMovieClip("img0_tmp_mc", theDepth++);
this.createEmptyMovieClip("img1_tmp_mc", theDepth++);
this["img" + currentHolder + "_mc"].loadMovie(image_arr[num] + ".jpg");
this["img" + currentHolder + "_tmp_mc"].onEnterFrame = function()
{
var l = this._parent["img" + currentHolder + "_mc"].getBytesLoaded();
var t = this._parent["img" + currentHolder + "_mc"].getBytesTotal();
if ((l >= t) && (t > 1) && (this._parent["img" + currentHolder + "_mc"]._width > 1))
{
this._parent["img" + currentHolder + "_mc"]._alpha = 1;
this._parent["img" + currentHolder + "_mc"]._y = 25;
_global.imageLoaded = true;
_global.selectedImage = num;
delete this.onEnterFrame;
this.removeMovieClip();
}
};
this["img" + ((currentHolder + 1) % 2) + "_tmp_mc"].onEnterFrame = function()
{
if (_global.imageLoaded)
{
if (this._parent["img" + currentHolder + "_mc"]._alpha < 100)
{
this._parent["img" + currentHolder + "_mc"]._alpha += 5;
this._parent["img" + ((currentHolder + 1) % 2) + "_mc"]._alpha -= 20;
}
else
{
this._parent["img" + currentHolder + "_mc"]._alpha = 100;
this._parent["img" + ((currentHolder + 1) % 2) + "_mc"]._alpha = 0;
currentHolder = (currentHolder + 1) % 2;
delete this.onEnterFrame;
this.removeMovieClip();
}
}
};
}
loadImage(_global.selectedImage);