Код AS1/AS2:
function loadBitmapSmoothed(_arg7, _arg5) {
clearTimeout(delay);
MoveNavWidth.stop();
footer_mc.slideshowAnim._alpha = 0;
var _local6 = _arg5.createEmptyMovieClip("bmc", _arg5.getNextHighestDepth());
var _local2 = new Object();
_local2.tmc = _arg5;
_local2.onLoadInit = function (_arg2) {
_arg2._visible = false;
var _local3 = new flash.display.BitmapData(_arg2._width, _arg2._height, true);
this.tmc.attachBitmap(_local3, this.tmc.getNextHighestDepth(), "auto", true);
_local3.draw(_arg2);
picturePosition();
};
_local2.onLoadComplete = function () {
fadeInImage();
};
var _local4 = new MovieClipLoader();
_local4.addListener(_local2);
_local4.loadClip(_arg7, _local6);
}
function fadeInImage() {
BigImageHolder._visible = true;
MoveNav = new mx.transitions.Tween(BigImageHolder, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1, true);
if (slideshow == "on") {
delay = _global.setTimeout(nextImgDelay, delay_img * 1000);
footer_mc.slideshowAnim._alpha = 100;
MoveNavWidth = new mx.transitions.Tween(footer_mc.slideshowAnim, "_width", mx.transitions.easing.Regular.easeOut, 0, Stage.width, delay_img, true);
MoveNavWidth.onMotionFinished = function () {
footer_mc.slideshowAnim._alpha = 0;
};
}
}
function toStage() {
thumbHolder.thumbsText._x = Stage.width / 2;
thumbHolder.bkg_mc._width = Stage.width;
if (photos == 1) {
thumbHolder._y = Stage.height - 134;
} else {
thumbHolder._y = Stage.height - 30;
}
stage_x = Stage.width;
preloader_mc._x = Stage.width / 2;
preloader_mc._y = Stage.height / 2;
footer_mc._y = Stage.height - 30;
footer_mc.rightSide._x = Stage.width - 407;
footer_mc.bkg_mc._width = Stage.width;
BigImageHolder._y = Math.round((Stage.height / 2) - (BigImageHolder.myImg.holder._height / 2));
BigImageHolder._x = Math.round((Stage.width / 2) - (BigImageHolder.myImg.holder._width / 2));
}
function toggleFullScreen() {
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
} else {
Stage["displayState"] = "normal";
}
}
Stage.scaleMode = "noScale";
Stage.align = "TL";
var difX;
var newX;
var speed = 0.2;
var p = 0;
var lastCategory = 0;
var thisButt = 0;
var photos = 0;
var slideshow = "on";
var albums = 0;
var GL = 0;
var lastThumb = 0;
footer_mc.bkg_mc.useHandCursor = false;
footer_mc.slideshowAnim._alpha = 0;
footer_mc.gallery_off._visible = false;
var imgLoader = new MovieClipLoader();
var imgListener = new Object();
imgLoader.addListener(imgListener);
category = new XML();
category.ignoreWhite = true;
category.onLoad = function (_arg4) {
if (_arg4) {
xmlNode = this.firstChild;
Title = [];
_global.link = [];
total = xmlNode.childNodes.length;
var _local3 = 0;
while (_local3 < total) {
Title[_local3] = xmlNode.childNodes[_local3].attributes.name;
_global.link[_local3] = xmlNode.childNodes[_local3].attributes.url;
footer_mc.galleryHolder.attachMovie("galleryItem", "item" + _local3, _local3 + 999);
footer_mc.galleryHolder["item" + _local3].title_txt.text = Title[_local3];
footer_mc.galleryHolder["item" + _local3].id = _local3;
footer_mc.galleryHolder["item" + _local3]._x = 0;
footer_mc.galleryHolder["item" + _local3]._y = (-_local3) * 23;
footer_mc.galleryHolder.item0.title_txt._alpha = 50;
footer_mc.galleryHolder.item0.button_bttn.enabled = false;
footer_mc.mask_mc._height = 25 * total;
footer_mc.gallery_off._height = (25 * total) + 50;
footer_mc.gallery_off._y = (-footer_mc.mask_mc._height) - 25;
footer_mc.galleryHolder["item" + _local3].button_bttn.onRollOver = function () {
footer_mc.galleryHolder["item" + [this._parent.id]].title_txt._alpha = 50;
};
footer_mc.galleryHolder["item" + _local3].button_bttn.onRollOut = function () {
footer_mc.galleryHolder["item" + [this._parent.id]].title_txt._alpha = 100;
};
footer_mc.galleryHolder["item" + _local3].button_bttn.onRelease = function () {
p = 0;
GL = this._parent.id;
lastThumb = 0;
BigImageHolder._alpha = 0;
BigImageHolder._visible = false;
BigImageHolder.left_arrow.gotoAndStop(3);
BigImageHolder.left_arrow["button"].enabled = false;
BigImageHolder.right_arrow.gotoAndStop(1);
BigImageHolder.right_arrow["button"].enabled = true;
delete thumbHolder.onEnterFrame;
var _local3 = 0;
while (_local3 < _global.total) {
removeMovieClip(thumbHolder.holder["thumb" + _local3]);
_local3++;
}
xmlData.load(_global.link[this._parent.id]);
lastCategory = this._parent.id;
footer_mc.galleryHolder["item" + thisButt].title_txt._alpha = 100;
footer_mc.galleryHolder["item" + thisButt].button_bttn.enabled = true;
thisButt = this._parent.id;
footer_mc.galleryHolder["item" + thisButt].title_txt._alpha = 50;
footer_mc.galleryHolder["item" + thisButt].button_bttn.enabled = false;
};
xmlData.load(_global.link[0]);
_local3++;
}
}
};
category.load("imageGallery/_galleries.xml");
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
picturePosition = function () {
BigImageHolder._y = Math.round((Stage.height / 2) - (BigImageHolder.myImg.holder._height / 2));
BigImageHolder._x = Math.round((Stage.width / 2) - (BigImageHolder.myImg.holder._width / 2));
BigImageHolder.bkg_mc._width = Math.round(BigImageHolder.myImg.holder._width + 20);
BigImageHolder.bkg_mc._height = Math.round(BigImageHolder.myImg.holder._height + 20);
BigImageHolder.bkg_mc._x = -10;
BigImageHolder.bkg_mc._y = -10;
BigImageHolder.right_arrow._x = Math.round(BigImageHolder.myImg.holder._width + 20);
BigImageHolder.right_arrow._y = Math.round(BigImageHolder.myImg.holder._height / 2);
BigImageHolder.left_arrow._x = -20;
BigImageHolder.left_arrow._y = Math.round(BigImageHolder.myImg.holder._height / 2);
BigImageHolder.description_mc.description_txt._width = BigImageHolder.myImg.holder._width - 20;
BigImageHolder.description_mc.bkg_mc._width = Math.round(BigImageHolder.myImg.holder._width);
BigImageHolder.description_mc.bkg_mc._height = BigImageHolder.description_mc.description_txt.textHeight + 15;
BigImageHolder.description_mc.mask_mc._width = Math.round(BigImageHolder.myImg.holder._width);
BigImageHolder.description_mc.mask_mc._height = BigImageHolder.description_mc.description_txt.textHeight + 15;
BigImageHolder.description_mc._x = 0;
BigImageHolder.description_mc._y = (BigImageHolder.myImg.holder._height - BigImageHolder.description_mc.description_txt.textHeight) - 15;
BigImageHolder.num_mc._x = 0;
BigImageHolder.num_mc._y = 0;
BigImageHolder.num_mc.bkg_mc._width = Math.round(BigImageHolder.myImg.holder._width);
};
BigImageHolder.myImg.onRollOver = function () {
BigImageHolder.myImg.useHandCursor = false;
MoveNav = new mx.transitions.Tween(BigImageHolder.description_mc, "_alpha", mx.transitions.easing.Strong.easeOut, BigImageHolder.description_mc._alpha, 100, 1, true);
MoveNav = new mx.transitions.Tween(BigImageHolder.num_mc, "_alpha", mx.transitions.easing.Strong.easeOut, BigImageHolder.num_mc._alpha, 100, 1, true);
};
BigImageHolder.myImg.onRollOut = function () {
MoveNav = new mx.transitions.Tween(BigImageHolder.description_mc, "_alpha", mx.transitions.easing.Strong.easeOut, BigImageHolder.description_mc._alpha, 0, 1, true);
MoveNav = new mx.transitions.Tween(BigImageHolder.num_mc, "_alpha", mx.transitions.easing.Strong.easeOut, BigImageHolder.num_mc._alpha, 0, 1, true);
};
slidingThumbs = function () {
var thumbWidth = (thumbHolder.holder._width + 20);
if (thumbWidth > Stage.width) {
thumbHolder.onEnterFrame = function () {
mouse_x = this._xmouse;
difx = (-mouse_x) * ((thumbWidth / stage_x) - 1);
newx = (difx - thumbHolder.holder._x) * speed;
thumbHolder.holder._x = thumbHolder.holder._x + Math.round(newx);
};
} else {
thumbHolder.holder._x = Math.round((Stage.width / 2) - (thumbHolder.holder._width / 2)) - 5;
delete thumbHolder.onEnterFrame;
}
};
toStage();
var stageL = new Object();
stageL.onResize = function () {
toStage();
};