Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    123

    photogallery con swf e xml

    Ciao a tutti.
    Ho creato un sistema per importare in un SWF una serie di JPG in sequenza con effetto di alpha tra di loro tramite file XML.

    aprendo il file SWF funziona tutto, ma il problema è che questo file si trova in una pagina HTML su un altro livello gerarchico del sito.... IN QUESTO CASO NON FUNZIONA PIU' il caricamento delle JPG.

    DA quanto mi sembra di capire il problema sono i riferimenti, cioè il percorso ai file che utilizo.....


    Vi chiedo questo piacere, via llego sia il codice che si trova nel file SFW per il link al file XML e poi la cosa più importante allego la struttura del mio sito facendo capire dove si trova:
    1. Il file HTML principale dove viene caricato tutto
    2. Il file SWF dove si trova la raccolta foto
    3. Il file XML che serve all'SWF per caricare le foto
    4. Le foto da inserire nel file SWF.

    Purtroppo non posso cambiare l'ordine delle cartelle o dei file perciò devo trovare una solizione a questo problema, spero che sia un problema di percorso...

    TENGO A PRECISARE CHE IL PERCORSO CHE SI TROVA NEL FILE XML PER ANDARE A PRENDERE LE FOTO E': ../../../FOTO/X/Y/FOTO1.JPG

    MENTRE IL LINK DALLA MOVIE CLIP NEL FILE SWF AL FILE XML E' FACILE PERCHè SI TROVA NELLA STESSA CARTELLA.


    P.S. MI PIACEREBBE SPOSTARE IL FILE XML DOVE SI TROVANO LE FOTO



    ---------------CODICE SWF --------------------------

    #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 _img = this.firstChild.childNodes[a].firstChild.nodeValue;
    this.path._dataProvider.push ({img:_img, 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.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


    ------------------- FINE SWF ----------------------


    aiutoooooooooooooo !!!
    Immagini allegate Immagini allegate

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    123
    scusa ma lo chema è sbagliato quello che ti ho allegato il corretto è questo che ti allego adesso...

    Da quello che mi dici posso mettere i file dove voglio io, basta che faccio in modo da linkare il tutto come se mi trovassi sempre nella pagina HTML principale dove viene iportato il tutto ?
    Immagini allegate Immagini allegate

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    123
    Grazie era una sciocchezza....
    ci sono riuscito...

    Grazie ancora !

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.