pouic Posted May 18, 2009 at 09:12 AM Report #265005 Posted May 18, 2009 at 09:12 AM Verifica se consegues perceber a lógica do som. Podes também utilizar parâmetros na função start para realizar loops na música [mais info] var mySound = new Sound(this);//Criar o objecto de som no stage mySound.attachSound("music.mp3"); // Carregar o ficheiro que pretende ouvir mySound.setVolume(25); // Colocar o volume inicial mySound.start();
pouic Posted May 18, 2009 at 11:58 AM Report #265038 Posted May 18, 2009 at 11:58 AM Para ficar mais limpo podes colocar assim var mySound = new Sound(this);//Criar o objecto de som no stage mySound.attachSound("musica.mp3"); // Carregar o ficheiro que pretende ouvir mySound.setVolume(25); // Colocar o volume inicial on (release) { mySound.start(); } Assim tens a possibilidade de captar o objecto mySound a partir de um outro botão para parar por exemplo. Se utilizares como sugeris-te apenas terás o objecto mySound dentro do release do botão.
pouic Posted May 18, 2009 at 11:12 PM Report #265240 Posted May 18, 2009 at 11:12 PM Verifica assim. Este código é para ActionScript 2.0, visto que não mencionas-te que linguagem estavas a utilizar... var mySound = new Sound(this);//Criar o objecto de som no stage mySound.loadSound("http://www.a1sounddownload.com/freesounds5/flatline.mp3");// Carregar o ficheiro que pretende ouvir fora da libraria mySound.setVolume(100);// Colocar o volume inicial this.createEmptyMovieClip("btn",0); btn.beginFill("0x000000",100); btn.lineTo(0, 0); btn.lineTo(20, 80); btn.lineTo(80, 20); btn.endFill(); btn.onRelease = function() { mySound.start(0,1); }
pouic Posted May 20, 2009 at 07:54 AM Report #265686 Posted May 20, 2009 at 07:54 AM Verifica se não tens de criar duas frames e colocar na primeira var mySound = new Sound(this);//Criar o objecto de som no stage mySound.loadSound("http://www.a1sounddownload.com/freesounds5/flatline.mp3");// Carregar o ficheiro que pretende ouvir fora da libraria mySound.setVolume(100);// Colocar o volume inicial e na segunda: mySound.start(0,1); stop();
pouic Posted May 21, 2009 at 01:33 PM Report #266133 Posted May 21, 2009 at 01:33 PM se vieres no help (F1) mySound.start(startPosition , numberLoops);
pouic Posted May 22, 2009 at 08:11 AM Report #266328 Posted May 22, 2009 at 08:11 AM Espero que percebas bem o código que estás a utilizar, pois dá para simplificar em 200% 😛 mas respondendo à tua dúvida.... _global.Behaviors.Sound.duzentosecinco.mp3.start(0,1000); //1000 = Número de loops //0 = Posição inicial do som Se pretenderes parar o som utiliza; _global.Behaviors.Sound.duzentosecinco.mp3.stop();
pouic Posted May 22, 2009 at 10:00 AM Report #266375 Posted May 22, 2009 at 10:00 AM Sim... Verifica .... _global.Behaviors.Sound.duzentosecinco.mp3.loadSound("duzentosecinco.mp3",true); _global.Behaviors.Sound.duzentosecinco.mp3.start(0,1000);
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now