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

Discussione: ciclo for

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    ciclo for

    ciao a tutti,

    perchè non incrementa la propieta alpha in base alla percentuale di caricamento??

    codice:
    onClipEvent (enterFrame) {
    	for (i = _root.progres; i < 100; i++) {
    	setProperty(_root.lancetta,_alpha, i);
    	trace(i);
    	}
    }
    dove progres è
    codice:
    tot = _root.getBytesTotal();
    car = _root.getBytesLoaded();
    progres = Math.round((car*100)/tot);
    if (car>=tot) {
        _root.gotoAndPlay(3);
    }
    grazie mille


  2. #2

    Re: ciclo for

    ma se scrivi semplicemente:
    codice:
    tot = _root.getBytesTotal();
    car = _root.getBytesLoaded();
    progres = Math.round((car*100)/tot);
    _root.lancetta._alpha=progres;
    if (car>=tot) {
        _root.gotoAndPlay(3);
    }

    :master:

    regalami un oggi da favola...e il domani bhe!?non mi importa se tu 6 con me! ©Ily

  3. #3
    Col for non riuscirai mai a vederla progressivamente, in quanto il for restituisce solo il "risultato finale" e non quelli intermedi, quindi vedrai solo l'alpha finale e non quello graduale..quindi come dice giustamente Yassassin devi usare un metodo diverso, mettendo ad esempio le azioni che ti ha dato lui dentro un enterFrame

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    Grazie mille,

    solo che cosi si piante flash

    codice:
    tot = _root.getBytesTotal();
    car = _root.getBytesLoaded();
    perc = Math.round(car/tot*10000);
    _root.lancetta._rotation += Math.PI*perc/360;
    _root.lancetta1._rotation -= Math.PI*perc/80;
    progres = Math.round((car*100)/tot);
    _root.lancetta._alpha=progres;
    if (car>=tot) {
        _root.gotoAndPlay(2);
    }

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    Grazie mille risolto!!


  6. #6
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    posso chiedervi un'altra cosina.... :adhone:


    io rilevo tutte le impostazioni cosi:
    codice:
    progres = "ricezione dati completata";
    function t(flag) {
    	return flag ? "abilitato" : "non abilitato";
    }
    sc = System.capabilities;
    ma = sc.manufacturer.split(" ");
    testo.text += ("Versione del player: "+sc.version+"\n");
    testo.text += ("Sistema operativo: "+sc.os+"\n");
    testo.text += ("Dimensioni: "+sc.screenResolutionX+"x"+sc.screenResolutionY+"\n");
    testo.text += ("Risoluzione: "+sc.screenDPI+" dpi"+"\n");
    testo.text += ("Linguaggio: "+sc.language+"\n");
    testo.text += ("Software: "+ma[0]+" per "+ma[1]+"\n");
    testo.text += ("Supporto Audio: "+t(sc.hasAudio)+"\n");
    testo.text += ("Decoder MP3: "+t(sc.hasMP3)+"\n");
    testo.text += ("Supporto Video: "+t(sc.hasVideoEncoder)+"\n");
    testo.text += ("Supporto accessibilità: "+t(sc.hasAccessibility)+"\n");
    testo.text += ("Debugger: "+t(sc.isDebugger));
    ma vorrei che mentre carica il filmato da 0 al 10 percento mi mostrasse
    codice:
    testo.text += ("Versione del player: "+sc.version+"\n");
    dal 10 al 20%
    codice:
    testo.text += ("Sistema operativo: "+sc.os+"\n");
    come posso fare??

    grazie ancora


  7. #7
    Sì, usando un if...else if

    tipo

    if(perc>10 && perc<20){
    // ...
    }else if(perc>20 && perc<30){
    // ....
    }etc...

  8. #8
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    mi puoi fare un'esempio aggiungendo i primi tre qui

    codice:
    tot = _root.getBytesTotal();
    car = _root.getBytesLoaded();
    perc = Math.round(car/tot*10000);
    _root.lancetta._rotation += Math.PI*perc/360;
    _root.lancetta1._rotation -= Math.PI*perc/80;
    progres = "ricezione dati " + Math.round((car*100)/tot) + " %";
    barra._xscale = Math.round((car*100)/tot);
    if (car>=tot) {
        _root.gotoAndPlay(3);
    }
    questo è il primo frame va tutto qui giusto??


  9. #9
    No, non posso fare un esempio aggiungendo i primi tre li.

  10. #10
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    perchè?? sbaglio qualcosa?? :master:

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 © 2024 vBulletin Solutions, Inc. All rights reserved.