Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114

    Player musicale. Aiuto!

    Allora sto realizzando un player che deve far partire una musica, può stopparla, può alzare il volume e abbassarlo!

    Quindi ho due frame;
    due livelli, il primo per i pulsanti e il secondo per le azioni;
    il primo pulsante si chiama mus (Play), il secondo mus_1 (stop);
    il pulsante del volume si chiama mus_down (volume-), mus_up (volume+).

    Nel primo frame (che si chiama "1") c'è uno stop(); , il pulsante mus e i pulsanti per il volume (ovviamente anche il livello azioni)
    Nel secondo frame c'è uno stop(); , il pulsante mus_1 e i pulsanti per il volume (ovviamente anche il livello azioni)

    Bene, perciò giungo al livello azioni che:
    1) Non fa partire alcuna musica
    3) I pulsanti volume sono non pervenuti

    Ecco lo script che inserisco nel frame rispettivo:
    -----------------------------------
    1 frame

    har = new Sound();
    har.attachSound("har");
    har.setVolume(50);
    mus.onRelease = function () {
    har.start(0 , 100);
    nextFrame();
    }

    vol_down.onRelease = function () {
    har.setVolume(har.getVolume()-10);
    }
    vol_up.onRelease = function () {
    har.setVolume(har.getVolume()+10);
    }
    ---------------------------------
    2 frame

    mus_1.onRelease = function () {
    gotoAndStop(1);
    stopAllSounds();
    }
    vol_down.onRelease = function () {
    har.setVolume(har.getVolume()-10);
    }
    vol_up.onRelease = function () {
    har.setVolume(har.getVolume()+10);
    }

    -----------------------------------

    La musica si chiama "har" ed è presente nella libreria (il nome esteso è più complesso, ed è un wav)
    Ho la versione 5 di flash



    Vi ringrazio ancora infinitamente per ogni vostro aiuto!

    Ciao;D

  2. #2
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    UP!

  3. #3
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    UP,UP!


  4. #4
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    UP, UP, UP! :master:

  5. #5
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    UP, UP, UP, UP!

    livello azioni che:
    1) Non fa partire alcuna musica
    3) I pulsanti volume sono non pervenuti

    Ecco lo script che inserisco nel frame rispettivo:
    -----------------------------------
    1 frame

    har = new Sound();
    har.attachSound("har");
    har.setVolume(50);
    mus.onRelease = function () {
    har.start(0 , 100);
    nextFrame();
    }

    vol_down.onRelease = function () {
    har.setVolume(har.getVolume()-10);
    }
    vol_up.onRelease = function () {
    har.setVolume(har.getVolume()+10);
    }
    ---------------------------------
    2 frame

    mus_1.onRelease = function () {
    gotoAndStop(1);
    stopAllSounds();
    }
    vol_down.onRelease = function () {
    har.setVolume(har.getVolume()-10);
    }
    vol_up.onRelease = function () {
    har.setVolume(har.getVolume()+10);
    }

    -----------------------------------

    La musica si chiama "har" ed è presente nella libreria (il nome esteso è più complesso, ed è un wav)
    Ho la versione 5 di flash
    ...Il resto da sapere è nel primo post!;P


    Come diavolaccio bisogna fare??

    :quote:

  6. #6
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    OK Trovato... dovevo andare con il tasto destro sul file musicale, cliccare Linkage e dargli un'identificativo! Che solfa... ma non possono considerarlo in automatico? Mah... valli a capire questi programmatori, in stile release!!! Che dislippa il consumismo.


  7. #7
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    103
    anche io ho un problem acon uno script (realizzato da un altra persona che io mi trovo a modificare) per far partire un brano musicale.
    Ora la musica parte solo se clicco il pulsante "Play" io vorrei che PArtisse quando si apre il sito e che si potesse fermare qualora uno lo desideri.
    Particolare è che la musica non è all'interno del filmato ma vieen chiamata da fuori ed è un mp3; come s enon bastasse adesso non deve partire una sola musica ma più di una a ripetizione...

    Questo è lo scritp che credo faccia aprtire tutto, tatnto è vero che io ho provato a cambiare brano ed effettivamente si è cambiato:

    if (overColor.substr(0, 1) == "#")
    {
    overColor = overColor.substr(1, 10);
    } // end if
    if (overColor == undefined)
    {
    overColor = "2570BA";
    } // end if
    if (overColor.substr(0, 2) != "0x")
    {
    overColor = "0x" + overColor;
    } // end if
    if (playerSkin == undefined)
    {
    playerSkin = "1";
    } // end if
    if (soundPath == undefined)
    {
    soundPath = "Dido.mp3";
    } // end if
    Stage.scaleMode = "noScale";
    _pc = 0;
    _pcLoaded = 0;
    _isLoaded = false;
    _isPlaying = false;
    _buffered = false;
    loadingMc._visible = false;
    if (autoPlay == undefined)
    {
    autoPlay = "no";
    } // end if
    _pos = 0;
    progressBar._xscale = _pc;
    loadingBar._xscale = _pcLoaded;
    btPause._visible = false;
    btTrack.enabled = false;
    btTrack.onPress = function ()
    {
    startMove();
    };
    btTrack.onRelease = function ()
    {
    stopMove();
    };
    btTrack.onReleaseOutside = btTrack.onRelease;
    slider.btVol.onPress = function ()
    {
    this.startDrag(0, 0, this._y, slider.back._width, this._y);
    this.onEnterFrame = function ()
    {
    var _loc2 = Math.floor(this._x / slider.back._width * 100);
    this._parent._parent.setVol(_loc2);
    };
    };
    slider.btVol.onRelease = function ()
    {
    this.stopDrag();
    };
    slider.btVol.onReleaseOutside = slider.btVol.onRelease;
    btPlay.onPress = function ()
    {
    trace ("play");
    if (!_buffered)
    {
    loadMp3(soundPath);
    }
    else
    {
    startPlayback();
    } // end else if
    };
    btPause.onPress = function ()
    {
    stopPlayback();
    };
    btStop.onPress = function ()
    {
    _snd.stop();
    stopPlayback();
    _buffered = false;
    progressBar._xscale = 0;
    delete progressBar.onEnterFrame;
    btTrack.enabled = false;
    };
    btRW.onPress = function ()
    {
    stopPlayback();
    _pos = 0;
    startPlayback();
    };
    btRW.onPress = function ()
    {
    startRW();
    };
    btRW.onRelease = function ()
    {
    stopRW();
    };
    btRW.onReleaseOutside = btRW.onRelease;
    btFF.onPress = function ()
    {
    startFF();
    };
    btFF.onRelease = function ()
    {
    stopFF();
    };
    btFF.onReleaseOutside = btFF.onRelease;
    setVol = function (pc)
    {
    _snd.setVolume(pc);
    };
    loadMp3 = function (path)
    {
    loadingMc._visible = true;
    loadingBar.onEnterFrame = function ()
    {
    _pcLoaded = _snd.getBytesLoaded() / _snd.getBytesTotal() * 100;
    loadingBar._xscale = _pcLoaded;
    };
    _snd = new Sound(this);
    this.onEnterFrame = function ()
    {
    if (_snd.position > 0)
    {
    btTrack.enabled = true;
    startPlayback();
    _buffered = true;
    delete this.onEnterFrame;
    _isLoaded = true;
    enablePlayer();
    loadingMc._visible = false;
    _global.playerMc.displayTimeProgress();
    } // end if
    };
    _snd.loadSound(path, true);
    };
    setOver = function (mc)
    {
    mc.onRollOver = function ()
    {
    this.gotoAndStop(2);
    };
    mc.onRollOut = function ()
    {
    this.gotoAndStop(1);
    };
    };
    getPcPlayed = function ()
    {
    var _loc1 = _snd.position / _snd.duration * 100;
    return (_loc1);
    };
    startPlayback = function ()
    {
    if (_buffered)
    {
    _snd.start(_pos, 0);
    } // end if
    progressBar.onEnterFrame = function ()
    {
    _pc = getPcPlayed();
    _pos = _snd.position / 1000;
    this._xscale = _pc;
    if (_pc == 100 && _pcLoaded == 100)
    {
    _global.playerMc.songIsFinished();
    } // end if
    };
    btPause._visible = true;
    btPlay._visible = false;
    btPause.gotoAndStop(1);
    btPlay.gotoAndStop(1);
    _isPlaying = true;
    };
    stopPlayback = function ()
    {
    delete this.onEnterFrame;
    _snd.stop();
    btPause._visible = false;
    btPlay._visible = true;
    btPause.gotoAndStop(1);
    btPlay.gotoAndStop(1);
    _isPlaying = false;
    };
    startRW = function ()
    {
    stopPlayback();
    progressBar.onEnterFrame = function ()
    {
    if (_pc > 0)
    {
    --_pc;
    } // end if
    _pos = _snd.duration / 1000 * (_pc / 100);
    progressBar._xscale = _pc;
    };
    };
    stopRW = function ()
    {
    startPlayback();
    };
    startFF = function ()
    {
    stopPlayback();
    progressBar.onEnterFrame = function ()
    {
    if (_pc < 100)
    {
    ++_pc;
    } // end if
    _pos = _snd.duration / 1000 * (_pc / 100);
    progressBar._xscale = _pc;
    };
    };
    stopFF = function ()
    {
    startPlayback();
    };
    startMove = function ()
    {
    stopPlayback();
    progressBar.onEnterFrame = function ()
    {
    var _loc1 = btTrack._xmouse / btTrack._width * 100;
    if (_loc1 > 100)
    {
    _loc1 = 100;
    } // end if
    if (_loc1 <= 0)
    {
    _loc1 = 0;
    } // end if
    _pos = _snd.duration / 1000 * (_loc1 / 100);
    progressBar._xscale = _loc1;
    };
    };
    stopMove = function ()
    {
    delete progressBar.onEnterFrame;
    startPlayback();
    };
    setOver(btPlay);
    setOver(btPause);
    setOver(btStop);
    setOver(btRW);
    setOver(btFF);
    disablePlayer();
    enablePlayer = function ()
    {
    btPlay.enabled = true;
    btPause.enabled = true;
    btRW.enabled = true;
    btFF.enabled = true;
    };
    disablePlayer = function ()
    {
    btPlay.enabled = false;
    btPause.enabled = false;
    btRW.enabled = false;
    btFF.enabled = false;
    };
    cnt = 0;
    if (autoPlay == "yes")
    {
    this.onEnterFrame = function ()
    {
    ++this.cnt;
    if (this.cnt > 5)
    {
    delete this.onEnterFrame;
    loadMp3(soundPath);
    } // end if
    };
    } // end if
    stop ();
    gotoAndStop(playerSkin);
    stop ();


    Cosa devo modificare per far si che la musica parta appena si carica il sito e continui a ripetizione fino a quando clicco pause?
    "btPlay " è il nome della clip filmato che aziona il play

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.