Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 7 of 7

Thread: Very noobish question(dont laugh), how to use sounds?

  1. #1

    Very noobish question(dont laugh), how to use sounds?

    Actually i dont have any idea how to make sounds work with movieclips, and how to control them via AS(AS2), so please give me all the resources tutorial and help you can about using sounds and controlling them via code.

    In this case however i need to play a small sound on hitTest with a movieclip, how do i do that exactly?

    Offtopic: what will be a good place to get some roalty free sounds for background music and effects?
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  2. #2
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Heres my way:

    First import the sound into your library (duh)

    Now right-click on it, select Linkage, check the Export for AS2/AS3 option and type in your Linkage Name

    Go back to your stage, select a frame and right-click for Actions

    Type in this code:

    var btnsound = new Sound();
    btnsound.attachSound("yoursoundslinkagename")

    Now, if you want to play this sound when the user rolls over a button do this:

    on(rollOver) {
    _root.btnsound.start(0,1)
    }

    This is play the sound once. If you want to loop the sound, just change the 1 into how many times you want looped. Obviously, you can change the rollOver option for almost anything. Hope this helps

    PS: Flashkit.com or Sounddogs have really good sound banks.
    Don't you ever, ever, EVER call me a Noob. I mean it!

  3. #3
    If you don't want to have it exported in the first frame (crap for preloader) uncheck that checkbox in linkage and have it play on a intermediary unused frame as "event"

    Code:
    on(rollOver) {
    _root.btnsound.start(0,1)
    }
    Try to avoid using Actionscript 1 and _root though

  4. #4
    All problems are solver thanks to both of you!!....now, a bit of topic, i need some sound effects, can you please help me search for it?
    telephone ringing-- "tring trrring"
    Slob --- as if a wet cloth struck something
    And a dissolving sound when changing scenes.---"shooosh"

    If you find a link for this, please provide it.
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  5. #5
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    As I said, you should try Flashkit or Sounddogs, but heres a few sounds you mentioned:

    Telephone Rings:

    http://flashkit.com/search.php?cat=s...term=Telephone

    Scene Change:

    http://www.flashkit.com/soundfx/Inte...-148/index.php

    http://www.flashkit.com/soundfx/Inte...-218/index.php

    Thats all I can find for now.
    Don't you ever, ever, EVER call me a Noob. I mean it!

  6. #6
    Ok now i have another problem...

    I have a background sound that i want to play throughout the game, but i want to lower its volume during the gameplay. I got it to work this far...but then,when i try to set the volume of my bullet sound bullet.setVolume(20); the background sound also gets set to 20....how can i change only one sound's volume?
    Last edited by bluemagica; May 16th, 2008 at 12:54 PM.
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  7. #7
    when you declare a sound attach it to a timeline (a movieclip)

    var btnsound = new Sound(this_mc);

    if you do not put anything between the brackets it attaches it to main time line

    when you lower the volume all sounds in one timeline are effected

    i personnally createempty movie clips to hold all my sounds

    try http://kennybellew.com/tutorial/ for all sound advice

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