A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: stopAllsounds question

  1. #1
    Member
    Join Date
    May 2001
    Posts
    40

    stopAllsounds question

    hello,

    ive been trying to set up two buttons to stop the sounds in my movie.
    actually, to mute and then be able to unmute the sound.
    however, it doesnt seem to be working. actually, it does work when i try it in an older movie that has many frames and streaming sound.
    what im working with now has a "start" sound and im only dealing with one frame.
    does the sound have to be streaming or can it be "start"? or is there a better way to approach this.

    thanks for any help offered.
    jon

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Posts
    7

    try that ...but not sure

    What if you're loading a mc that contains 2 frames . first frame: stopallsound action, second frame: same thing + put a gotoAndPlay(1) on second frame... that might work since its stoping all sounds every frame...

    Not sure but I think this would work fine!

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    If it's a non-looping song, one way is to make a new movie clip. Drag the sound from the library to the first frame of it's own layer. Go down the timeline and set a blank keyframe at the end of the sound jagged line. Add a stop(); Click the layer so it turns black, then set the Sync to Stream. Drag the clip to the main stage and use your buttons to stop and play the clip instance. This stops the clip timeline and starts it at the same frame it stoped at when you tell it to play again.

    There are a number of other ways using attachSound, but I don't know what your using to play the sound.

  4. #4
    Member
    Join Date
    May 2001
    Posts
    40
    thanks.
    ill give that a shot.
    but ive been trying to get Sound.setVolume to work and this wont work either. wouldnt this be an easy way to mute and unmute?
    i just cant get this to work either, "sound" should be the name of my music file, right? just whatever it says in the library?
    and if this will work, does it have to be a stream? again, its just not working.
    but ill try that other idea now.
    thanks again,
    jon

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Never use the word sound for anything but the action new Sound. Sound is a flash keyword and it can confuse the flashplayer if you use it for anything else. Call it mySound or sound1 or just snd or even s.

    If you set the linkage identifier for the sound, yes, you can set the volume of it, either from a frame or button. In the timeline for the sound, you set the Sync for Stream, but it is not a true streaming sound. It's just something I've found that works. You can start and stop it like an event sound, but you can also set the volume like a streaming sound. By rights, it shouldn't work, but it does.

    If you send me your email address to this, I'll send you an fla that shows how it's done. It's too big for an attachment.

    iaskwhy2000@yahoo.com

  6. #6
    Member
    Join Date
    May 2001
    Posts
    40
    actually, it looks like i got it to work.
    thanks for all your help.

    next problem.. im using two buttons, "on" and "off".. i want the button to stay in the down position for whichever it is. but i cant seem to make it stay. any suggestions?

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Just make a duplicate down state graphic, put it in a mc. Make that mc invisible to start with. Lay that mc exactly over your button and when it's pressed just turn on the visibility of your over mc. When the off button is pressed, make the on mc invisible again, and another off mc visible.

  8. #8
    Member
    Join Date
    May 2001
    Posts
    40
    im actually having some trouble making the connection here between the over and the under graphics.
    i cant seem to make the over(fake button) react when the real button is released. it either does nothing, or instantly go to the down position without clicking on it.

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Have you given your over mc an instance name, and are you setting it's visibility on the "on release" action of your button?

    Can you attach your .fla?

  10. #10
    Member
    Join Date
    May 2001
    Posts
    40
    instance name, didnt think of that. sorry! let me check that out.
    also, cant attach it because its over 8megs. which is another problem, i put an mp3 into it to test the sound so the size of the fla went from about 50KB to about 8MB, i removed the mp3 and its still huge. its definitely not in the library, is there somewhere else i should dig to find a copy or reference of this mp3?
    thanks!

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