The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: Attaching sound when enemy dies?

  1. #1

    Attaching sound when enemy dies?

    Hi guys.
    I've been making this pretty cool game and I've got all coding right and all but what I want to do is when the enemy dies (when hittest with char) I want it to play the sound "ding". I've tried so many things such as attachAudio attachSound etc...
    Could someone please tell me exactly what I need to type. The audio name in the library is: ding.

    Please reply a.s.a.p!

  2. #2
    is this in as2 or as3?

    Assuming it's as3 at the start of the flash do:

    var soundURL:URLRequest = new URLRequest("string to the sound filename");
    var deathSound:Sound = new Sound();

    and then in the death function do:

    deathSound.play();
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012