Skip to main content
Participant
December 23, 2020
Answered

How do I press a key to stop sounds?

  • December 23, 2020
  • 2 replies
  • 313 views

I'm currently working on a soundboard in Flash CS5 Actionscript 3.0, I am somewhat new to this, so I was wondering if anyone still knows how to set it so I can press the spacebar to stop all of the sounds currently playing. Would help me a lot and I would much appreciate a response. Thanks!

    This topic has been closed for replies.
    Correct answer jeromie_adobe

    You would want to create an event listener on the keypress, and a corresponding callback function to stop the sounds.  

    https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d01.html

     

    But like other folks have pointed out, you'd be far better off building an equivalent in JavaScript unless there's a profoundly compelling reason to use Flash (you're maintaining a legacy application in an enterprise environment, etc).  Animate CC lets you output animation to native web technologies.  I'd highly recommend downloading a trial, and checking out the Animate CC forums.

    2 replies

    jeromie_adobeCorrect answer
    Adobe Employee
    December 23, 2020

    You would want to create an event listener on the keypress, and a corresponding callback function to stop the sounds.  

    https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d01.html

     

    But like other folks have pointed out, you'd be far better off building an equivalent in JavaScript unless there's a profoundly compelling reason to use Flash (you're maintaining a legacy application in an enterprise environment, etc).  Animate CC lets you output animation to native web technologies.  I'd highly recommend downloading a trial, and checking out the Animate CC forums.

    Nancy OShea
    Community Expert
    Community Expert
    December 23, 2020

    "I'm currently working on a soundboard in Flash CS5 Actionscript 3.0"

    I don't mean to be flippant, Lester5E61, but why bother?

    Flash Player is being permanently discontinued in a couple of weeks.  Without a player, nobody will be able to do anything with your Flash-based app.

    https://www.adobe.com/products/flashplayer/end-of-life.html

     

    Suggest you switch from outdated Flash CS5 to modern Animate CC.

     

    Nancy O'Shea— Product User & Community Expert