PDA

View Full Version : Dissolvenza flash e xml


{Red}Lyon
15-07-2009, 15:15
Ciao, ho un problema con uno script per dissolvenza di immagini caricate tramite xml.

Sto usando uno script scaricato da qui (http://www.sephiroth.it/file_detail.php?id=124), all'interno c'è un file swf e un file xml personalizzabile...

sto cercando di mettere questi files swf e xml 2 volte in una stessa pagina...solo che tutte e due le animazioni caricano sempre le stesse immagini a prescindere dal fatto che io cambi le foto all'interno dei file xml...sembra come se tutte e due caricassero lo stesso file xml...

come posso far si che ogni animazione carichi un determinato file xml diverso dall'altro?

grazie

zuper
15-07-2009, 16:12
sorry nn ho editor di fla al momento installati...

ma immagino che tra le varie opzioni dentro ci sia specificato il file xml dove punta :)

{Red}Lyon
15-07-2009, 17:57
questa è la sorgente per il caricamento XML e immagini:
#initclip 1
ImageFader = function () {
this.__init__ ();
};
ImageFader.prototype = new MovieClip ();
// ** init class ** //
ImageFader.prototype.__init__ = function () {
this._xscale = 100
this._yscale = 100
this.bounding_box.unloadMovie()
this._fader_.unloadMovie()
this._dataProvider = new Array ();
this._count = 0;
this._depth = 1;
this._isLoaded = -1;
if (this._S_) {
clearInterval (this._S_);
}
if (this._xmlfile != "") {
this.loadXML (this._xmlfile);
}
};
// *** load the external xml ** //
ImageFader.prototype.loadXML = function (x) {
var _xml = new XML ();
_xml.ignoreWhite = true;
_xml.path = this;
_xml.load (x);
_xml.onLoad = function () {
for (var a = 0; a < this.firstChild.childNodes.length; a++) {
var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
var _pause = this.firstChild.attributes.PAUSE
var _lnk = this.firstChild.childNodes[a].attributes.LINK
var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
this.path._dataProvider.push ({img:_img, link:_lnk, transition:_trans, pause:_pause});
}
this.path.startFading ();
delete this;
};
};
// ** start fading procedure ** //
ImageFader.prototype.startFading = function () {
if (this._dataProvider.length > 0) {
this.makeFader(true)
}
};
// ** load images ** //
ImageFader.prototype.makeFader = function (first) {
this._isLoaded = -1;
this._tmp = this.attachMovie ("ImageLoader", "ImageLoader" + this._depth, this._depth++);
this._old1 = this['ImageLoader' + (this._depth - 1)]
this._old2 = this['ImageLoader' + (this._depth - 2)]
this._tmp.loadHandler ("isLoaded", this._count);
this._tmp.autoStart = false;
this._tmp.transition = this._dataProvider[this._count].transition
this._tmp.pause = this._dataProvider[this._count].pause
this._tmp.title = this._dataProvider[this._count].title
this._tmp.link = this._dataProvider[this._count].link
this._tmp.loadImage (this._dataProvider[this._count].img);
this._t1 = getTimer()
this.onEnterFrame = function(){
this._t2 = getTimer()
if((this._t2 - this._t1) > this._dataProvider[this._count].pause || first==true){
if(this._isLoaded == this._count || this._isLoaded == 1 && this._count == 0){
delete this.onEnterFrame;
this._tmp.start()
this._old1.fadeOut()
this._old2.removeMovieClip()
if(this._count + 1 < this._dataProvider.length){
this._count++
this.makeFader()
return;
} else {
if(this._loop == true){
this._count = 0
this.makeFader()
}
}
}
}
}
};
// ** which has been loaded ? ** //
ImageFader.prototype.isLoaded = function (num) {
this._isLoaded = num;
};
Object.registerClass ("ImageFader", ImageFader);
#endinitclip


io metto il file .swf nella radice /flash e il file images.xml in /flash/dissolv/
ho provato prima a cambiare _xml.load (x); in _xml.load ("/flash/dissolv/images.xml"); e non funziona, cioè carica il file swf ma non mi fa vedere nulla...
poi ho provato a cambiare così:
prima:
_xml.path = this;
_xml.load (x);
dopo:
_xml.path = "/flash/dissolv/";
_xml.load ("images.xml");

ma fa sempre la stessa cosa, cioè non mi fa vedere nulla...

le foto si trovano nella stessa cartella del file xml

zuper
15-07-2009, 19:52
nn mi pare di vedere nulla che punti al file xml

forse c'è qualche altra opzione nel file flash