Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    preload che va oltre il 100%

    com'è possibile che questa operazioen dia 196%
    Math.round(((_root.testi.bytesLoaded()/_root.testi.bytesTotal())*100)

    prima stavo su un altro host free su cui a volte avevo problemi nel caricamento del fiel soun do txt
    o nn l'ho trovavno NaN
    o si fermavano a metà caricamento 76%
    e nn andava oltre

    ho pensato forse è legato al server
    cambimolo (mi piacerebbe sapere però qual'è la logica con cui un host possa dare questi problemi)

    ora sto su un altro server free
    qui prima il testo mi andava a 196% e nn si sposta al frame sucessivo a meno che nn si facia ilr efresh della pagina
    per tagliare la testa la toro
    l'ho sommato al caricamento
    della grafica e ora il preloada rriva a 101 e nn spostamento al framenext coem sopra


    aiuto è il mio curriculum ci faccio una brutta figura

  2. #2
    cos'e' _root.testi , un LoadVars ?
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  3. #3
    _root.testi = new LoadVars();
    _root.testi.load("testi/testo.txt");

  4. #4
    codice:
    var loader = new LoadVars();
    loader.__reset = function() {
    	clearInterval(this.__interval);
    };
    loader.onData = function(dt) {
    	this.__reset();
    	trace( dt );
    };
    loader.onLoad = function(success) {
    	this.__reset();
    	if (success) {
    		// fai quello che devi fare
    	} else {
    		// ciao
    	}
    };
    loader.onLoadProgress = function(bL, tL) {
    	if (
    		isNaN(bL) == false && 
    		isNaN(tL) == false && 
    		bLn != undefined && 
    		tL != undefined &&
    		tL >= 0
    		) {
    		
    		// metti le cose da fare al preload
    		trace(bL+' => '+tL);
    	}
    };
    loader.loadWithProgress = function(txt:String) {
    	this.load(txt);
    	this.__interval = setInterval(
    		this, 
    		'onLoadProgress', 
    		20, 
    		this.getBytesLoaded(), 
    		this.getBytesTotal()
    	);
    };
    loader.loadWithProgress( "myfile.txt" );
    piu' o meno una cosa di questo tipo
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  5. #5
    grazie perl'aiuto ora lo provo

    ma cosa sono queste funzioni
    nn le ho mai viste usare
    nn ci sono neppure nell'elenco azioni actionscript


    __reset
    clearInterval(this.__interval);
    onLoadProgress
    loadWithProgress

    nn le ho mai viste?

    ma perhcè nn è sufficciente scrivere

    onClipEvent (load) {
    _root.testi = new LoadVars();
    _root.testi.load("testi/testo.txt");
    }

    onClipEvent (enterFrame) {
    suono = Math.round((_root.testi.getBytesLoaded()/_root.testi.getBytesTotal())*100);
    perc1.perc = "sound "+per1+"%";

    }

    per quale motivo la percentuale sballa

  6. #6
    non esistono perche' le ho implementate io , in pratica quello che ho scritto e' un oggetto LoadVars con preload incorporato, l' ho inventato io prima ma se non ti va di provarlo continua col tuo metodo
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  7. #7
    no lo uso
    anche perchè nn so come risolvere questo problema
    perhcè fa così

  8. #8
    nemmeno ci provi ??? ... guarda che non ti formatta il PC


    comunque sia

    suono = Math.round((_root.testi.getBytesLoaded()/_root.testi.getBytesTotal())*100);
    perc1.perc = "sound "+per1+"%";


    o suono e' inutile, o per1 arriva dall' altro pianeta ? :master:
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  9. #9
    noooo l'ho appena pubblicato
    per il codice ho fatto un coppia e incolla veloce in realtà è così

    onClipEvent (load) {
    _visible = 0;
    _root.stop();
    _root.testi = new LoadVars();
    _root.testi.load("testi/testo.txt");
    loadMovieNum("sound.swf", 10);
    }

    onClipEvent (enterFrame) {
    if (_root.getBytesLoaded() == _root.getBytesTotal() && _level10.getBytesLoaded() == _level10.getBytesTotal() && _root.testi.getBytesLoaded() == _root.testi.getBytesTotal()) {
    _level10.nextFrame();
    _root.nextFrame();
    } else {
    _visible = 1;

    // grafica testi
    base = Math.round(((_root.getBytesLoaded()+_root.testi.ge tBytesLoaded())/(_root.getBytesTotal()+_root.testi.getBytesTotal() ))*100);
    per2 = freccia2._x=base;
    perc2._x = base;
    perc2.perc = "grafica "+per2+"%";

    // sound
    suono = Math.round((_level10.getBytesLoaded()/_level10.getBytesTotal())*100);
    per1 = freccia1._x=suono;
    perc1._x = suono;
    perc1.perc = "sound "+per1+"%";

    }
    }

  10. #10
    ok
    ora nn c'è + l'errore
    dovrei guardarmi bene il codice per capire che gai scritto
    che prevedi con quel codice
    magari così si arriva all'errore
    o tu hai già un idea?

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.