A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: play sound on mouse release

  1. #1
    Member
    Join Date
    May 2000
    Posts
    33

    Question

    I'm creating a simple puzzle game where pieces have to be dragged and dropped onto the correct spaces. I'm using an the button "down" state to control a sound when you pick up a piece, but I'm having trouble figuring out how to make the game play a sound when you drop the piece in the correct location.

    I'm using the "droptarget" property to determine if the user drops the piece on the correct target. I've tried making the movie go to a frame where a sound exists (and then jump back to the puzzle loop), but it doesn't seem to play. I've also tried loading an external swf file into a movie clip, but there is too much of a delay (especially if you don't have a fast connection).

    Why isn't there an action for "play sound"?

    Thanks in advance.

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,092

    Post

    Hi im not sure how to do that but i do have an idea for you that might just work.

    take the sound that confirms that the player has droped the piece in the right target.

    and make a little movie clip.
    now in the first frame put a stop action
    make a key frame in the second frame
    now add that sound in
    and set the Sync Box to Start.
    now add a Key frame to frame 3 in the movie clip and add the stop action.

    Next drag the movie clip from your library
    on to the stage.
    Give it an instance name like confirm.

    Now use Tell Target in you code to
    Go To and Play frame 2 when the correct piece is in place.

    That's the best idea i got right now for you.

    Need more help just let me know

    Jeff A.



    [This message has been edited by jydnas (edited 13 May 2000).]

  3. #3
    Junior Member
    Join Date
    May 2000
    Posts
    4

    Post

    hi
    go to the button properties and on the "down" frame add a sound ;-)

    ------------------
    ()HELPER()

  4. #4
    Member
    Join Date
    May 2000
    Posts
    33

    Post

    Thanks, Jeff. I'll give that a try.

    I did try directing the movie to a frame with a sound in the frame. Maybe it will work if there's a placed movie clip. Should there be a difference?

    - Lisa

  5. #5
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,092

    Smile

    You can use both but i tend to use Movie clips
    because it gives more control.

    That way if the main time line has to go to a certain frame or play to a certain frame
    you still can get a movie clip to complete another task like Set up Variables.

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