A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: sounds when I click

  1. #1
    Sir solves own questions :-D
    Join Date
    May 2003
    Location
    IL
    Posts
    216

    sounds when I click

    ok I want to attach a sound to my cursor for every time I click. I have the sound already. The cursor is an aimer and the sound is like a gun shooting. The thing is when I put on the sound it stops the cursor from working normally. (the way i did it). Does anyone know of another way

  2. #2
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    Code:
    onClipEvent(mouseDown) {
    	s = new Sound();
    	s.attachSound("your_sound_ID");
    	s.start();
    }

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

  3. #3
    Sir solves own questions :-D
    Join Date
    May 2003
    Location
    IL
    Posts
    216
    where do I put that code?? Do I put it on the main timeline. Or do I make a button inside my movieclip with that? I tried the second one and it made the mouse not work

  4. #4
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,651
    You have to put it on a button. Probably your enemy will be one. Then change the
    Code:
    your_sound_ID
    to "shoot" and give the sound file the linkage name of "shoot" in the library.

  5. #5
    Sir solves own questions :-D
    Join Date
    May 2003
    Location
    IL
    Posts
    216
    if i send u the fla will u edit it for me??

    The graphics are bad. Get the fla here www.robsgames.cjb.net !

    The fla is the download the fla file here! link

  6. #6
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,651
    Ok, it's done


    http://hem.thalamus.nu/~hnm007791/awsome.zip

    I couldn't find any shooting sound so I added one... The gun sound I added doesn't fit your weapon..... Just change it..

  7. #7
    Sir solves own questions :-D
    Join Date
    May 2003
    Location
    IL
    Posts
    216
    THANK YOU SOOO MUCH!!!!

  8. #8
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,651
    No problem

  9. #9
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    As a side note, this would be 'more correct'. =P
    Code:
    onClipEvent(load){
    	s = new Sound();
    	s.attachSound("sound");	
    }
    onClipEvent(mouseDown) {
    	s.start();
    }
    But it doesn't matter too much. Except if your game already uses lots of lines of code per frame and you want to keep the amount of code running to a minimum..

    | "Keep Flashing!"-Jeroen
    PHP multiplayer? Check this thread: PHPgateway

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center