A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    34

    sound off doesnt work

    hi, I've put this within a MC, but the attached sound on main stage won't go off. I suspect it has something to do with Depthswapping of my MC's. Anyone?????


    on (release) {
    gotoAndPlay(81);
    }
    on (release) {
    _root.depth++;
    this.swapDepths(_root.depth);
    }
    on (press) {
    if (playing==true) {
    _root.mySound.stop("main");
    playing=false;
    }
    }

  2. #2
    Senior Member green_eye's Avatar
    Join Date
    Apr 2004
    Location
    Sarasota, Florida
    Posts
    1,496
    Do you want the mc snd to turn off??
    Target that MC

    snd1 = new Sound(snd_mc);


    _root.snd1.stop();

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    34
    noop that already works.. i wanna turn the main stage sound off

  4. #4
    Senior Member green_eye's Avatar
    Join Date
    Apr 2004
    Location
    Sarasota, Florida
    Posts
    1,496
    stopAllSounds();
    That will stop all playing sounds not just
    a snd
    Last edited by green_eye; 06-21-2004 at 08:59 PM.

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    hi.
    sorry to butt in.
    i've tried the stopAllSounds thing before (and got it to work)
    but does it have an opposite?
    i've tried startAllSounds, BeginAllSounds etc (my imagination ran dry after that)

    is there an opposite to stopAllSounds?

  6. #6
    Senior Member green_eye's Avatar
    Join Date
    Apr 2004
    Location
    Sarasota, Florida
    Posts
    1,496
    No
    What are you trying to do?

  7. #7
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    i'm being lazy.

    i know that the best thing to do would be to commit to learning the actionscript that governs sound but i was looking for an easy way out.

    ie. onrelease stopallsounds
    onrelease startallsounds

    to make a simple sound toggle
    my site is www.nobodypolitic.com
    and i think its nice to have the background music but nicer still to be able to turn it off or even change it

  8. #8
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    why not just set volume to 0 when button is clicked and when other button is clciked set volume to the property of the sound
    like if it was just one button and press it to toggle
    code:

    soundon = true;
    on(press) {
    if(soundon) {
    _root.mySound.setVolume(0);
    soundon = false;
    }
    if(!soundon) {
    _root.mySound.setVolume(100);
    soundon = true;
    }
    }


    not sure if that will work but its worth a try
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  9. #9
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    nice one joejoe, i'll give that a bash

    cheers!

  10. #10
    Senior Member green_eye's Avatar
    Join Date
    Apr 2004
    Location
    Sarasota, Florida
    Posts
    1,496
    call the snd from server

    snd1 = new Sound();
    snd1.loadSound("your.mp3", true);
    you can NOT stream a wav file
    Last edited by green_eye; 06-24-2004 at 07:51 PM.

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