dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: turn on/off button

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    17

    Cool

    how can i turn on and off the music with the same button?
    Im going mad

  2. #2
    Bin Laden And Co.
    Join Date
    May 2000
    Posts
    869
    Make a movie clip..
    In this movieclip just make 2 blank keyframe seperate from eachother..In the first blank keyframe put a stop action and label it play..Put the sound in that one..
    Then in the second blank keyframe put a stop action label it stop..
    Label that m/c sound..
    Then make a button on the main timeline..
    and give the following action to the button
    on (release) {
    if (Number(playing) == 0) {
    stopAllSounds ();
    tellTarget ("sound") {
    gotoAndStop ("stop");}
    playing = 1;
    } else {
    tellTarget ("sound") {
    gotoAndStop ("play");}
    playing = 0;
    }
    }

    Hope it helps



  3. #3
    Bin Laden And Co.
    Join Date
    May 2000
    Posts
    869
    Make a movieclip..
    In it make 2 blank keyframe 5 frames from each other..
    Label the first one play the second stop..Put the sound in the frist blank keyframe and nothing in the other..And put stop actions in bother of them..
    Than label this movieclip sound and make a button on the main timeline..
    In the button give the following actions

    on (release) {
    if (Number(playing) == 0) {
    stopAllSounds ();
    tellTarget ("sound") {
    gotoAndStop ("stop");
    tellTarget ("but") {
    gotoAndStop ("off");
    }
    } playing = 1;
    } else {
    tellTarget ("sound") {
    gotoAndStop ("play");
    playing = 0;
    }
    }

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