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

    swf caricato in un altro swf

    Buongiorno,
    ho scaricato da flash kit uno scroll di immagini verticale con questo codice

    codice:
    spacing = 4;
    containerMC._alpha = 0;
    
    MovieClip.prototype.loadPic = function(pic){
    	_root.containerMC._alpha = 0;
    	this.loadMovie(pic);
    	_root.onEnterFrame = function(){
    		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
    		if (t != 0 && (l/t) == 1){
    			var w = containerMC._width + spacing, h = containerMC._height + spacing;
    			border.resizeMe(w, h);
    			delete _root.onEnterFrame;
    		}
    	}
    };
    MovieClip.prototype.resizeMe = function(w, h){
    	var speed = 1;
    	this.onEnterFrame = function(){
    		this._width += (w - this._width)/speed;
    		this._height += (h - this._height)/speed;
    		if( Math.abs(this._width-w)<1){
    			this._width = w;
    			this._height = h;
    			_root.containerMC._x = this._x - this._width/2 + spacing/2;
    			_root.containerMC._y = this._y - this._height/2 + spacing/2;
    			_root.containerMC._alpha = 100;
    			delete this.onEnterFrame;
    		}
    	}
    };
    Il problema è che è in un swf esterno caricato nel mc contenitore "sezione" e quindi non va. Cosa devo modificare?

    grazie

  2. #2
    la questione è che ora i percorsi sono cambiati ecco xchè nn ti funge....
    sono due le strade da seguire...
    la prima
    prova ad inserire nel frame del swf esterno

    this._lockroot = true;
    (sorry ho sbagliato a scrivere questo è esatto)

    che serve a fissare la root di quest'ultimo

    altrimenti devi cabiare tutti i precorsi che fanno riferimento alla root
    cioè questi...

    _root.containerMC._x .
    ....

    in
    _root.istanza_tuo_contenitore.containerMC._x=..... .

    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
    ciao Crescenzo!
    avevo già provato... Ho modificato in questo modo ma non è cambiato nulla.....


    codice:
    spacing = 4;
    containerMC._alpha = 0;
    
    MovieClip.prototype.loadPic = function(pic){
    	_root.sezione.containerMC._alpha = 0;
    	this.loadMovie(pic);
    	_root.onEnterFrame = function(){
    		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
    		if (t != 0 && (l/t) == 1){
    			var w = containerMC._width + spacing, h = containerMC._height + spacing;
    			border.resizeMe(w, h);
    			delete _root.onEnterFrame;
    		}
    	}
    };
    MovieClip.prototype.resizeMe = function(w, h){
    	var speed = 3;
    	this.onEnterFrame = function(){
    		this._width += (w - this._width)/speed;
    		this._height += (h - this._height)/speed;
    		if( Math.abs(this._width-w)<1){
    			this._width = w;
    			this._height = h;
    			_root.sezione.containerMC._x = this._x - this._width/2 + spacing/2;
    			_root.sezione.containerMC._y = this._y - this._height/2 + spacing/2;
    			_root.sezione.containerMC._alpha = 100;
    			delete this.onEnterFrame;
    		}
    	}
    };
    quando nel main clicco sul pulsante di questo swf esterno è tutto fermo... vedo le immagini ma non scrolla nulla......

  4. #4
    ok funziona tutto!
    grazie!

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.