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");
}

 


Page chargée en 0.001 sec.

Dernière Modification : Jeu 12 Mai 2022 10:33
Copyright © 1999-2022 Jean-Paul Molina Tous droits réservés.

 

to Google