codice:
}
function next():Void {
if (current<infostruc.length) {
current += 1;
}
updateInfo();
}
function previous():Void {
if (current>1) {
current -= 1;
}
updateInfo();
}
function displayAlternArt(art, width:Number, height:Number):Void {
artDisplay.attachMovie(art, "artwork", 1);
artDisplay.artwork._width = width;
artDisplay.artwork._height = height;
}
function loadNext(dir:String):Void {
if (!loadedAll) {
var num:Number = current-1;
while (infostruc[num].loaded && num<infostruc.length) {
num++;
}
if (num>=infostruc.length) {
var num:Number = current-1;
while (infostruc[num].loaded && num>0) {
num--;
}
if (num<=0) {
loadedAll = true;
}
}
var newLoad:MovieClip = this.createEmptyMovieClip("artLoad"+num, this.getNextHighestDepth());
newLoad._alpha = 0;
var mc:Object = {};
mc.number = num;
var artLoader:MovieClipLoader = new MovieClipLoader();
artLoader.addListener(mc);
artLoader.loadClip("./"+infostruc[num].art, newLoad);
mc.onLoadError = function(target:MovieClip) {
loadNext();
};
mc.onLoadInit = function(target:MovieClip) {
root["_bmd"+this.number] = new BitmapData(target._width, target._height);
root["_ref"+this.number] = new BitmapData(target._width, target._height);
root["_bmd"+this.number].draw(target);
var mc:MovieClip = target.createEmptyMovieClip("gradient_mc", target.getNextHighestDepth());
matrix = new Matrix();
matrix.createGradientBox(target._width, target._height, reflectionRotation/180*Math.PI, 0, 0);
mc.beginGradientFill(reflectionFillType, reflectionColors, reflectionAlphas, reflectionRatios, matrix, reflectionSpreadMethod, reflectionInterpolationMethod, reflectionFocalPointRatio);
mc.moveTo(0, 0);
mc.lineTo(0, target._height);
mc.lineTo(target._width, target._height);
mc.lineTo(target._width, 0);
mc.lineTo(0, 0);
mc.endFill();
root["_ref"+this.number].draw(target);
infostruc[this.number].loaded = true;
target.removeMovieClip();
loadNext();
};
}
}
xmlData.onLoad = function(success:Boolean):Void {
if (success) {
for (var i:Number = -1; this.childNodes[0].childNodes[++i]; ) {
var cNode:XMLNode = this.childNodes[0].childNodes[i].childNodes;
infostruc.push({art:cNode[0].childNodes, info:unescape(cNode[1].childNodes), auth:unescape(cNode[2].childNodes), loaded:false});
}
loadStat = "";
init();
} else {
loadStat = "There was an error loading that data, sorry.";
}
};
myMO.onMouseWheel = function(delta:Number):Void {
if (delta>0) {
next();
} else if (delta<=0) {
previous();
}
};
myKO.onKeyDown = function():Void {
if (Key.isDown(Key.RIGHT)) {
next();
} else if (Key.isDown(Key.LEFT)) {
previous();
}
};
scrollBar.scroller.onPress = function():Void {
dist = this._parent._xmouse-this._x;
this.onMouseMove = function():Void {
tmp = 1+Math.ceil(((this._parent._xmouse-dist)-scrollBarStart)/(scrollBar._width-scrollBarStop)*(infostruc.length-1));
if (tmp>infostruc.length) {
tmp = infostruc.length;
}
if (tmp<1) {
tmp = 1;
}
current = tmp;
updateInfo();
};
};
scrollBar.scroller.onRelease = scrollBar.scroller.onReleaseOutside=function ():Void {
stopDrag();
delete this.onMouseMove;
};
scrollBar.left.onPress = function():Void {
previous();
shifter = setInterval(previous, scrollerDelay);
};
scrollBar.right.onPress = function():Void {
next();
shifter = setInterval(next, scrollerDelay);
};
scrollBar.onMouseUp = function():Void {
clearInterval(shifter);
};
scrollBar.onMouseDown = function():Void {
if (this.hitTest(_xmouse, _ymouse, true) && !this.left.hitTest(_xmouse, _ymouse, true) && !this.right.hitTest(_xmouse, _ymouse, true)) {
if (this._xmouse<this.scroller._x) {
previous();
shifter = setInterval(previous, clickDelay);
}
if (this._xmouse>this.scroller._x+this.scroller._width) {
next();
shifter = setInterval(next, clickDelay);
}
}
};
fscreen.onPress = function():Void {
fscommand("fullscreen", !(this._currentframe-1));
this.gotoAndStop(!(this._currentframe-1)+1);
};
xmlData.ignoreWhite = true;
xmlData.load(fileXml);
this.createEmptyMovieClip("loader", this.getNextHighestDepth());
mask._alpha = 0;
scrollBar.scroller._y = 0;
scrollBar.swapDepths(1101);