Problem z galerią flashowa z XML
: wt cze 28, 2005 2:40 pm
Witam zrobiłem taką galerię www.test20053.republika.pl w której jest taki skrypt:
Oczywiscie nie znam az tak AS zebym to ja napisal w/w skrypt
A odnosnie problemu do tej galerii to chodzi mi o to ze potrzebuje zrobic buttony za pomoca ktorych kolejne zdjecia pokazwylaby sie tak jak w miniaturkach ale wlasnie tez w powiekszonych zdjeciach
Kod: Zaznacz cały
var fileName:String;
var fromNum:Number;
var maxNum:Number;
var current:Number;
var list:XML;
var root:XMLNode;
var toLoad:MovieClip;
var jpgLoader:MovieClipLoader;
fileName = 'list.xml';
mask.initMask();
loader._visible = false;
fromNum = 0;
toLoad = container2;
jpgLoader = new MovieClipLoader();
jpgLoader.addListener(loader);
loader.onLoadStart = function() {
this._visible = true;
this.strip._xscale = 0;
with (this._parent) {
title.text = '';
description.text = '';
}
};
loader.onLoadProgress = function(tmc, bl, bt) {
this.strip._xscale = Math.round(bl/bt*100);
};
loader.onLoadComplete = function() {
this._visible = false;
with (this._parent) {
title.text = root.childNodes[current].childNodes[0].firstChild.nodeValue;
description.text = root.childNodes[current].childNodes[1].firstChild.nodeValue;
numTxt.textColor = 0x333333;
numTxt.text = '[ '+(current+1)+' / '+maxNum+' ]';
toLoad.setMask(mask);
mask.playMask();
}
};
list = new XML();
list.ignoreWhite = true;
list.load(fileName);
list.onLoad = function(success:Boolean) {
if (!success) {
trace('Błąd, nie można było załadowac pliku!');
return;
}
root = this.firstChild;
maxNum = root.childNodes.length-1;
loadSmallImgs(fromNum);
};
function loadSmallImgs(n:Number):Void {
for (var i = 0; i<9; i++) {
this['small_'+i].loadSmall(root.childNodes[n+i].attributes.small);
this['small_'+i].num = n+i;
}
fromNum = n;
}
function loadPicture(n:Number):Void {
if (current) {
numTxt.textColor = 0x999999;
numTxt.text = '[ '+(current+1)+' > '+(n+1)+' ]';
}
mask.resetMask();
toLoad.setMask(null);
if (toLoad.getBytesLoaded() == toLoad.getBytesTotal()) {
if (toLoad == container2) {
toLoad = container1;
} else {
toLoad = container2;
}
container1.swapDepths(container2);
}
jpgLoader.loadClip(root.childNodes[n].attributes.big, toLoad);
current = n;
}
prev.onRelease = function() {
if (fromNum>0) {
this._parent.loadSmallImgs(--fromNum);
}
};
next.onRelease = function() {
if (fromNum<maxNum-9) {
this._parent.loadSmallImgs(++fromNum);
}
};
beg.onRelease = function() {
this._parent.loadSmallImgs(0);
};
end.onRelease = function() {
this._parent.loadSmallImgs(maxNum-9);
};
down.onPress = function() {
this._parent.description.scroll++;
};
up.onPress = function() {
this._parent.description.scroll--;
};A odnosnie problemu do tej galerii to chodzi mi o to ze potrzebuje zrobic buttony za pomoca ktorych kolejne zdjecia pokazwylaby sie tak jak w miniaturkach ale wlasnie tez w powiekszonych zdjeciach