Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    27

    mp3Player: funziona offline, online NO

    Ho fatto un player mp3, ma non funziona online, mentre nel flashPlayer funziona benissimo.
    questo è lo script che ho usato, mi sapreste suggerire?
    Grazie
    ..Ikniv

    ==============================================
    //variabili globali
    _global.Player = this;
    //
    //------------------------------------------------------------------------
    Player.createEmptyMovieClip("Contiene1", 1);
    Player.createEmptyMovieClip("Contiene2", 2);
    Player.createEmptyMovieClip("Contiene3", 3);
    //
    brano1 = new Sound(Contiene1);
    //
    brano1.loadSound("Sound1.mp3", false);
    brano1.onLoad = function() {
    brano1.start(0, 2000);
    };
    qualeBrano = 1;
    //
    function preloadSound(brano) {
    var bT:Number = brano.getBytesTotal();
    var bL:Number = brano.getBytesLoaded();
    var pB = Math.floor(bL/bT*100);
    caricato = "LOADED: "+pB+"%";
    if ((bT == bL) && (bT>0) && (bT != NaN)) {
    clearInterval(buffer);
    }
    }
    //
    function stoppaBrani() {
    brano1.stop();
    brano2.stop();
    brano3.stop();
    delete brano1;
    delete brano2;
    delete brano3;
    }
    //sullo stage nel MC del Player c'è un MC (cVolume) che contiene un'altro MC (regolo) il cui valore _x regola il volume
    function settaVolume(branoDaSettare) {
    branoDaSettare.setVolume(Math.round(cVolume.regolo ._x*2));
    }
    //
    settaggio = setInterval(settaVolume, 500, brano1);
    buffer = setInterval(preloadSound, 1000, brano1);
    //
    //---------------------------------------------variabili<<
    statoMusica = "on";
    //-----------------------------------settaggi<<
    //bt1, bt2 e bt3 sono i MC che scelgono la canzone e hanno due frame, uno illuminato ("on") e uno spento ("off")
    //onOff è un bottone con la stessa struttura dei bt1, bt2, bt3.
    bt1.gotoAndStop("on");
    bt2.gotoAndStop("off");
    bt3.gotoAndStop("off");
    //
    bt1.onRelease = function() {
    stoppaBrani();
    qualeBrano = 1;
    clearInterval(settaggio);
    clearInterval(buffer);
    //
    brano1 = new Sound(Contiene1);
    brano1.loadSound("Sound1.mp3", false);
    brano1.onLoad = function() {
    brano1.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano1);
    settaggio = setInterval(settaVolume, 500, brano1);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("on");
    bt2.gotoAndStop("off");
    bt3.gotoAndStop("off");
    };
    //
    bt2.onRelease = function() {
    stoppaBrani();
    qualeBrano = 2;
    clearInterval(settaggio);
    clearInterval(buffer);
    //
    brano2 = new Sound(Contiene2);
    brano2.loadSound("Sound2.mp3", false);
    brano2.onLoad = function() {
    brano2.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano2);
    settaggio = setInterval(settaVolume, 500, brano2);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("off");
    bt2.gotoAndStop("on");
    bt3.gotoAndStop("off");
    };
    //
    bt3.onRelease = function() {
    stoppaBrani();
    qualeBrano = 3;
    clearInterval(settaggio);
    clearInterval(buffer);
    //
    brano3 = new Sound(Contiene3);
    brano3.loadSound("Sound3.mp3", false);
    brano3.onLoad = function() {
    brano3.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano3);
    settaggio = setInterval(settaVolume, 500, brano3);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("off");
    bt2.gotoAndStop("off");
    bt3.gotoAndStop("on");
    };
    //
    onOff.onRelease = function() {
    if (statoMusica == "on") {
    //spegne la musica
    stoppaBrani();
    clearInterval(settaggio);
    clearInterval(buffer);
    onOff.gotoAndStop("off");
    statoMusica = "off";
    } else if (statoMusica == "off") {
    //accende la musica
    if (qualeBrano == 1) {
    qualeBrano = 1;
    clearInterval(settaggio);
    clearInterval(buffer);
    stoppaBrani();
    //
    brano1 = new Sound(Contiene1);
    brano1.loadSound("Sound1.mp3", false);
    brano1.onLoad = function() {
    brano1.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano1);
    settaggio = setInterval(settaVolume, 500, brano1);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("on");
    bt2.gotoAndStop("off");
    bt3.gotoAndStop("off");
    } else if (qualeBrano == 2) {
    qualeBrano = 2;
    clearInterval(settaggio);
    clearInterval(buffer);
    stoppaBrani();
    //
    brano2 = new Sound(Contiene2);
    brano2.loadSound("Sound2.mp3", false);
    brano2.onLoad = function() {
    brano2.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano2);
    settaggio = setInterval(settaVolume, 500, brano2);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("off");
    bt2.gotoAndStop("on");
    bt3.gotoAndStop("off");
    } else if (qualeBrano == 3) {
    qualeBrano = 3;
    clearInterval(settaggio);
    clearInterval(buffer);
    stoppaBrani();
    //
    brano3 = new Sound(Contiene3);
    brano3.loadSound("Sound3.mp3", false);
    brano3.onLoad = function() {
    brano3.start(0, 2000);
    };
    //
    buffer = setInterval(preloadSound, 1000, brano3);
    settaggio = setInterval(settaVolume, 500, brano3);
    statoMusica = "on";
    onOff.gotoAndStop("on");
    bt1.gotoAndStop("off");
    bt2.gotoAndStop("off");
    bt3.gotoAndStop("on");
    }
    }
    };
    //
    xRegolo = 25;
    cVolume.onPress = function() {
    cVolume.regolo.startDrag(true, 0, cVolume.regolo._y, 50, cVolume.regolo._y);
    };
    cVolume.onRelease = cVolume.onReleaseOutside=function () {
    stopDrag();
    cVolume.regolo._x = Math.round(cVolume.regolo._x);
    };
    //
    stop();

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Un po' troppo codice da guardare così..

    Cos'è che non funziona? (non puoi linkare al file fla?)

  3. #3

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Visto, e mi pare funzioni. Cosa c'è che non va?

  5. #5
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    27
    online non funziona
    quando stoppo un suono non lo ricarica più
    Dal player funziona benissimo
    ma online mi da problami

    provalo un po' all'indirizzo:
    http://www.vangogh-creative.it/staff...io/Player.html

  6. #6
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    27
    Ho appena scoperto una cosa, se lo visualizzo sul mac, funziona benissimo, mentre ho provato su due pc e mi da lo stesso problama.

    Ma perché!?!

    Comunque grazie Negatyve

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.