Condition If and Playsound

 

You noticed your script became red when writing something like :
If ( condition ) PlaySound(" ........");
Here is a workaround with the use of labels
For instance, enter :
onFrame (2) { stop(); }
onFrame (3)
{
          setLabel("SOUND1");
          playSound("my_sound.wav");
}
onEnterFrame()
{
          if ( a_condition ) gotoAndPlay("SOUND1");
}

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.041 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google