[Flash]Ajuda em fazer uma acção iniciar automaticamente

miquelx

Membro
Boas,
eu hoje decidi dar um aspecto mais profissional á minha webradio e então arranjei um flash player para o shoutcast e tenho andado a mudar lá aquilo e notei que quando entro no site a rádio nao começa a dar automaticamente e tenho de clicar no play o que é chato para novos visitantes. Então o que eu queria fazer é fazer a acção iniciar automaticamente. Estava a pensar se era possivel criar uma especie de caixa que nao se visse e que fizesse a ligação á radio sem ser preciso clicar nem nada disso.
este é o codigo do botao play:
Código:
on (release)
{
    function stream()
    {
        System.security.allowDomain("http://83.144.153.151:8000/");
        myRadio = new String("http://83.144.153.151:8000/;");
        mySound = new Sound();
        mySound.loadSound(myRadio, true);
        mySound.start();
    } // End of the function
    function clearBuffer()
    {
        mySound.stop();
        delete mySound;
        stream();
    } // End of the function
    stream();
    var intervalID = setInterval(clearBuffer, 1200000);
    timerinProgress = false;
    musicOn = true;
}
o código base (penso eu que seja o codigo base) :
Código:
function stream()
{
    System.security.allowDomain("http://83.144.153.151");
    myRadio = new String("http://http://83.144.153.151:8000/;");
    mySound = new Sound();
    mySound.loadSound(myRadio, true);
    mySound.start();
} // End of the function
function clearBuffer()
{
    mySound.stop();
    delete mySound;
    stream();
} // End of the function
timerinProgress = false;
musicOn = true;
offonText = "OFF";
System.security.allowDomain("http://http://83.144.153.151");
myRadio = new String("http://http://83.144.153.151:8000/;");
mySound = new Sound();
mySound.loadSound(myRadio, true);
mySound.start();
var vol = 80;
_root.onEnterFrame = function ()
{
    _root.mySound.setVolume(vol);
};
var intervalID = setInterval(clearBuffer, 1200000);

cumps
 
Penso que basta por o código que tens dentro da action para o botão play, na action da frame inicial, e assim quando ele te abrir o flash, corre esses comandos e portanto é como se tivesse carregado no play.

Código:
    function stream()
    {
        System.security.allowDomain("http://83.144.153.151:8000/");
        myRadio = new String("http://83.144.153.151:8000/;");
        mySound = new Sound();
        mySound.loadSound(myRadio, true);
        mySound.start();
    } // End of the function
    function clearBuffer()
    {
        mySound.stop();
        delete mySound;
        stream();
    } // End of the function
    stream();
    var intervalID = setInterval(clearBuffer, 1200000);
    timerinProgress = false;
    musicOn = true;
 
Back
Topo