Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Kaycee
    Kaycee's Avatar
    Guest

    How to add sound clips onto buttons through Flash CS3 ActionScript 2.0?

    i am making a shooting game through flash cs3 and i want to have the sound make noise when you shoot the target and then goes onto the next ... how do i do that?

    ive tired for ages and for some reason i doesnt work

    please help

  2. #2
    Blackeagle's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    2
    Downloads
    0
    Uploads
    0
    here is a quick and easy way to achive it.

    var snd = new Sound();//create a varable to hold the new sound object
    snd.attachSound("mysound"); //attaches the sound to the varible with the name mysound

    myBtn_btn.onPress = function() { //assuming u have a btn or mc on the stage called myBtn_btn
    snd.play();// play the sound
    };

    myBtn_btn.onRelease = function() { //assuming u have a btn or mc on the stage called myBtn_btn
    snd.stop();// stop the sound
    };

 

 

Quick Reply Quick Reply

Click here to log in


What color is our footer?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 03-30-2010, 02:02 AM
  2. Replies: 0
    Last Post: 11-12-2009, 08:51 PM
  3. How to make sound clips shorter in flash cs3?
    By Ace_Killington in forum Discuss Flash
    Replies: 0
    Last Post: 09-06-2009, 03:52 PM
  4. Replies: 0
    Last Post: 05-01-2009, 07:46 AM
  5. Replies: 0
    Last Post: 03-23-2009, 05:05 PM

Bookmarks

Posting Permissions

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