2 Replies Latest reply on Jan 30, 2008 5:29 AM by Newsgroup_User

    easy sound question

    phil1943 Level 1
      I want a gunshot sound to activate when the SPACE bar is pressed.
      It works fine, however the short sound is within the onEnterFrame event handler, and it repeats many times whilst the user holds down the space bar for a fraction of a second.
      How do I make that sound activate just once per SPACE bar press, regardless of how long SPACE bar is held down ?

      if (Key.isDown(Key.SPACE)) {
      _mysound.start();
      }