Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question countdown with sound

    ok so I have a 30 second count down with a 14 second sound file which I have set to repeat 3 times so it spans more than 30 seconds. my problem is is that the sound continues to play after 30- seconds even though I added a stopAllSounds(); at the end of the countdown timer actionscript


    Code:
    //Minute countdowner (Minutnedräknaren)
    //By Kenneth Andersson aka Kenzilla, 2006.
    //Use it however you like.
    //
    //First we need a dynamic textfield with instance name "theText", check.
    //Then we set the total number of minutes. I picked 64 to reduce the
    //result-view-waiting-time. 119 would just be... boring.
    total = 30;
    //Calculate the var total and update the textfield.
    this.onEnterFrame = function() {
    	minutes = Math.floor(total/60);
    	seconds = total%60;
    	if (seconds<=9 && minutes<=9) {
    		theText.text = "0"+minutes+" : "+"0"+seconds;
    	} else if (seconds<=9) {
    		theText.text = minutes+":"+"0"+seconds;
    	} else if (minutes<=9) {
    		theText.text = "0"+minutes+" : "+seconds;
    	} else {
    		theText.text = minutes+" : "+seconds;
    	}
    };
    //Function for the countdown, can be changed to total++ if you want to
    //count "into the future" or something. Well I dunno.
    //clearInterval = When minutes and seconds is 00:00 it stops.
    counter = function () {
    	total--;
    	if (minutes == 0 & seconds == 1) {
    		clearInterval(setIt);
    	}
    };
    //Then we start an interval with the counter function, 1000 is milliseconds á 1 sec.
    setIt = setInterval(this, "counter", 1000);
    
    stop();

  • #2
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question

    can anyone help here?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •