A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: New user needs help!

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    6
    HELP! I just got Flash 5 and am trying to figure it out. I just want to make simple buttons that, when pressed, play a .wav file. Please help!

    jcb1979@yahoo.com

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    6

    ...

    I've gotten to where I put the sound file into my library, I highlight the one I want, go to options, do "New Symbol," draw a little circle on the white part, right click on "over," "down," and "hit," and do the "insert ketframe" and change the color, then I go to "Actions," and amke the button PLAY when PRESSED, then "enable simple buttons," then test movie, but no sound. How do I make this?!

    Please help!

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    6
    Help? anyone?

  4. #4
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    Ok, here goes...

    Create 3 layers, name them "sound" "actions" and "buttons".

    Create your symbols: One button for Sound On, on for Off

    In the "actions" layer create 2 Blank keyframes.
    In Frame #1 you assign the following action: Stop
    In Frame #2 you assign the following action: Stop

    In the "Sound" layer, create the same 2 blank keyframes.
    In Frame #2 you insert your sound.

    In the "buttons" layer, create the same 2 blank keyframes.
    In Frame #1 insert your "On" button. Assign the following actions to the button: on release, goto and play frame 2.
    In Frame #2 Insert your "Off" button. Assign the following actions to the button: on release, goto and play frame 1.

    I'm also a bit new to Flash, so I'm not sure if it works. If not, just reply here. Hope it works.



  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    421
    when you "test the movie" are you just playing it in flash or are you actually previewing the movie? I believe that for sounds to play you need to actually preview it. To do this simply hit Ctrl-Enter and a new window will appear. If on a mac, i believe it's Command-Return.

  6. #6
    Junior Member
    Join Date
    Apr 2002
    Posts
    6
    that worked quite well...one problem tho; i have to click the button twice to get the sound to play again. i click it once, it plays. then i click it again and nothing. then again and it plays. what gives?

  7. #7
    Junior Member
    Join Date
    Apr 2002
    Posts
    6
    and how can I make multiple buttons?

  8. #8
    in the button where it says hit you have to draw a square thats why ur button is not working look for the button on the library an then where it say hit draw a square so it maps the button when u click on it ..

  9. #9
    Junior Member
    Join Date
    Apr 2002
    Posts
    6
    what do you mean?

  10. #10
    ur button is not working cuz u need to draw a square a little bigger than the button in the last layer where it says hit it should be the last layer of the button.

  11. #11
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    If you click, it playes the sound. If you click again, it stops playing the sound. Try importing a longer sound, then you'll see. If you just want a button to play the sound, do the following.

    Create your button.

    Create 3 Layers: "Sound" "Button" and "Actions".

    In the sounds layer, create 3 blank keyframes.
    In the 2nd keyframe, insert your sound.

    In the actions layer, create 3 blank keyframes.
    Assign the following actions to the 1st frame: stop
    Assign the following actions to the 3rd frame: goto and play frame 1

    In the Button Layer, insert your button in the already present blank keyframe. Select the 3rd frame, click your right mouse button and select, "insert frame".
    Assign the following actions to the button: goto and play frame 2

    That's it.


  12. #12
    mxter bluereef's Avatar
    Join Date
    Feb 2002
    Posts
    167
    well, to start with. all you have to do is to go to lessons in flash. heres what can do. go to flash "window" (menu) and go to lessons and yu would learn everything youu wanna know from there!

  13. #13
    Member
    Join Date
    Feb 2002
    Posts
    79
    Depending on how you want to code it, you could do this.

    Type this actionscript in frame one of the main movie.

    mySound_sound=new Sound();

    function sample (whichsound) {
    mySound_sound.attachSound(whichsound);
    mySound_sound.start(0,1);
    }

    then put your button on the stage and give it this actionscript.

    on (release) {
    sample(sound1);
    }

    Finally, import your sound to the library. Right click on it and go to linkage. Click on the export for actionscripting box and give it the name sound1 (since that is what we used when we called the function with the button).

    This should work. You could have other buttons that say
    on (release) {
    sample (sound2);
    }
    etc.

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