Visualizzazione dei risultati da 1 a 7 su 7
  1. #1

    Come è possibile inserire nel seguente script anche la funzione onRelease da xml?

    Possiedo il seguente codiche che effettua una visualizzazione di immagini:
    codice:
    #initclip
    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
    Il file xml è composto nel seguente modo:

    codice:
    <?xml version="1.0" ?>
    
    <RSS PAUSE="4000">
    
    <IMAGE TRANSITION="5">a01.jpg</IMAGE>
    <IMAGE TRANSITION="6">a02.jpg</IMAGE>
    <IMAGE TRANSITION="7">a03.jpg</IMAGE>
    
    
    </RSS>
    Il mio obbiettivo è quello di inserire un link ad ogni immagine visualizzata, come posso fare?

    Ad esempio il file xml deve essere così composto:
    codice:
    <?xml version="1.0" ?>
    
    <RSS PAUSE="4000">
    
    <IMAGE TRANSITION="5" LINK="http:\\www.miodito1.it">a01.jpg</IMAGE>
    <IMAGE TRANSITION="6" LINK="http:\\www.miodito2.it">a02.jpg</IMAGE>
    <IMAGE TRANSITION="7" LINK="http:\\www.miodito3.it">a03.jpg</IMAGE>
    
    
    </RSS>

    Qualcuno mi da un aiutino? Vi rigrazio anticipatamente.

  2. #2
    beh questo mi sa che che il componente di sephirot

    cmq mi sembra che ci ho già sbariato e messo il link
    vediamo come fare

    supponendo che il file xml sia fatto cosi

    <?xml version="1.0"?>
    <!--
    set transition number from 1 to 9
    set transition number to 0 for random effect
    -->
    <RSS PAUSE="4000">
    <IMAGE TRANSITION="1" LINK="www.prova1.it">a01.jpg</IMAGE>
    <IMAGE TRANSITION="1" LINK="www.prova2.it">a02.jpg</IMAGE>
    <IMAGE TRANSITION="1" LINK="www.prova3.it">a03.jpg</IMAGE>
    </RSS>



    prima cosa metti un area sensibile sul componente
    cioè selezioni il componente fai tasto dx modifica e dentro ci metti l'area sensibile
    con quese azioni

    on (release) {
    getURL("_root.linkroot[_root.nummio]")


    }

    poi nello script del componente
    Codice PHP:
    #initclip
    _root.nummio=0;
    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();
        
    link= new Array()
        
    linkroot= new Array()
        
    _xml.ignoreWhite true;
        
    _xml.path this;
        
    _xml.load(x);
        
    _xml.onLoad = function() {
            for (var 
    0a<this.firstChild.childNodes.lengtha++) {
                var 
    _trans this.firstChild.childNodes[a].attributes.TRANSITION;
                var 
    _link this.firstChild.childNodes[a].attributes.LINK;
                var 
    _pause this.firstChild.attributes.PAUSE;
                var 
    _img this.firstChild.childNodes[a].firstChild.nodeValue;
                
    this.path._dataProvider.push({img:_imgtransition:_transpause:_pause});
                
    pushed=link.push(_link); 
                
    //link=_link
                
    trace(_root.nummio)
                
                
            }
            
            
    _root.linkroot=link
            trace
    ("linkroot"+linkroot)
            
    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._depththis._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 == && this._count == 0) {
                    
    delete this.onEnterFrame;
                    
    this._tmp.start();
                    
    this._old1.fadeOut();
                    
                    
    this._old2.removeMovieClip();
                    
    trace(nummio)
                    if (
    this._count+1<this._dataProvider.length) {
                        
    _root.nummio=_root.nummio+1;
                        
    this._count++;
                        
    this.makeFader();
                        return;
                    } else {
                        if (
    this._loop == true) {
                            
    _root.nummio=0;
                            
    this._count 0;
                            
    this.makeFader();
                        }
                    }
                }
            }
        };
    };
    // ** which has been loaded ? ** //
    ImageFader.prototype.isLoaded = function(num) {
        
    this._isLoaded num;
    };
    Object.registerClass("ImageFader"ImageFader);
    #endinitclip 
    dovrebbe fungere
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  3. #3
    Grazie per l'aiuto funziona alla grande!!!


    L'unica cosa, per qualcuno che deve utilizzare il seguente script, sull'area sensibile deve scrivere in questo modo:

    on (release) {
    getURL(_root.linkroot[_root.nummio])

    }

    Senza le doppie apici.


    Ringrazio nuovamente "Crescenzo" per l'aiuto

  4. #4
    Originariamente inviato da crescenzo
    beh questo mi sa che che il componente di sephirot

    cmq mi sembra che ci ho già sbariato e messo il link
    vediamo come fare

    Si è di sephirot e devo dire che ho apprezzando il suo lavoro, soprattutto su questo visualizzatore di immagini.

  5. #5
    Originariamente inviato da The_Matrix
    Grazie per l'aiuto funziona alla grande!!!


    L'unica cosa, per qualcuno che deve utilizzare il seguente script, sull'area sensibile deve scrivere in questo modo:

    on (release) {
    getURL(_root.linkroot[_root.nummio])

    }

    Senza le doppie apici.


    Ringrazio nuovamente "Crescenzo" per l'aiuto
    si ovvio avevo dimenticato di cancellarle dato che si tratta di var......

    si è di sephirot cmq lo script ........

    l'importante è che funge


    alla prox
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  6. #6
    in effetti cè qualcosa che nn va ma ora invece prova questo
    ho fatto delle modifiche

    Codice PHP:
    #initclip
    //_root.nummio=0;
    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();
        
    link= new Array()
        
    linkroot= new Array()
        
    _xml.ignoreWhite true;
        
    _xml.path this;
        
    _xml.load(x);
        
    _xml.onLoad = function() {
            for (var 
    0a<this.firstChild.childNodes.lengtha++) {
                var 
    _trans this.firstChild.childNodes[a].attributes.TRANSITION;
                var 
    _link this.firstChild.childNodes[a].attributes.LINK;
                var 
    _pause this.firstChild.attributes.PAUSE;
                var 
    _img this.firstChild.childNodes[a].firstChild.nodeValue;
                
    this.path._dataProvider.push({img:_imgtransition:_transpause:_pause});
                
    pushed=link.push(_link); 
                
    //link=_link
                
    trace("nummio="+_root.nummio)
                
                
            }
            
            
    _root.linkroot=link
            trace
    ("linkroot"+linkroot)
            
    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._depththis._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 == && this._count == 0) {
                    
    delete this.onEnterFrame;
                    
    this._tmp.start();
                    
    this._old1.fadeOut();
                    
                    
    this._old2.removeMovieClip();
                    
                    
    trace("count "+this._count+1)
                    
    trace(this._dataProvider.length)
                    if (
    this._count+1<this._dataProvider.length) {
                        
    _root.indice=this._count;
                        
    //trace("indice questo"+_root.indice)
                        
    this._count++;
                        
    this.makeFader();
                        return;
                    } else {
                        
    _root.indice++
                        if (
    this._loop == true) {
                                if (
    this._count+1==this._dataProvider.length) {
                                    
    _root.indice=_root.indice
                                    
    //trace("indice questo d"+_root.indice)
                                
    }
                            
    this._count 0;
                            
    this.makeFader();
                        }
                    }
                    
                    
                }
            }
        };
    };
    // ** which has been loaded ? ** //
    ImageFader.prototype.isLoaded = function(num) {
        
    this._isLoaded num;
    };
    Object.registerClass("ImageFader"ImageFader);
    #endinitclip 
    e sul pls invece
    on (release) {
    trace(_root.linkroot[_root.indice])
    }

    ora i sa che va bene
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  7. #7
    ora i sa che va bene
    Grazie nuovamente. Domani mattina riprovo e se ho ancora problemi riposto qui

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.