How to reset my Timer

Hello!

I have a question and I hope I can find a solution here. I have a short questionnaire and I want to allow the user only 30 seconds per question to give a good answer.

I have a 'start' button, which triggers a countdown for the first time. So, I want whenever the user clicks the 'next' button, the countdown to start the new meter from 30 to 0. That's what I've tried so far:

var fl_SecondsToCountDown:Number = 30;

var fl_CountDownTimerInstance:Timer = new Timer (1000, fl_SecondsToCountDown);

fl_CountDownTimerInstance.addEventListener (TimerEvent.TIMER, fl_CountDownTimerHandler);

start_btn.addEventListener (MouseEvent.Click, startCountdown);

next_btn.addEventListener (MouseEvent.CLICK, goNext);

function fl_CountDownTimerHandler(event:TimerEvent):void

{

seconds_txt. Text = String (fl_SecondsToCountDown);

-fl_SecondsToCountDown;

}

function startCountdown(e:MouseEvent):void {}

fl_CountDownTimerInstance.start ();

}

function goNext(e:MouseEvent):void {}

fl_CountDownTimerInstance.reset ();

}

Now, what he does is just to stop the countdown to 25 seconds, for example, and then if I ask him to do it again, it starts where he left, rather than return to 30 seconds more.

Thank you very much!

use:

function fl_CountDownTimerHandler(event:TimerEvent):void

{

seconds_txt. Text = String(fl_CountDownTimerInstance.repeatCount-fl_CountDownTimerInstance.currentCount);

}

Tags: Adobe Animate

Similar Questions

  • How to reset the time in the lower right corner, so it remains set automatically

    original title: Windows Internet Explorer 8 - time

    How to reset the time in the lower right corner, so it is set automatically.

    ccrow

    The time is not defined in Internet Explorer. The time is a function of the o/s. right click on the time and see what happens.

  • How to reset the timer to zero?

    Good day people,

    How to reset the timer to zero?

    I have a button in the timeline relative to the code below, and when I click on it I want to the behavior of the time back to 1 or 0.

    Click the timer to 1 or 0.

    -----------------------------------

    contents_mc - timer_txt

    -----------------------------------

    _root.elapseTime = 0;

    intervalId = setInterval (this, "countDown", 1000);

    function countDown() {}

    {if (_root.timerOn)}

    ++ _root.elapseTime;

    " _root.elapseTime = _time +" "seconds";

    if(_root.elapseTime == 10) {}

    _parent.gotoAndStop ("GameOutOfTime");

    clearInterval (intervalId);

    }

    }

    }

    Stop();

    Any response will be appreciated,

    Thank you

    use:

    function resetF (): Void {}

    clearInterval (intervalID);

    intervalId = setInterval (countDown, 1000);

    }

  • How to reset the time to 0:0 seconds to 1 Bar?

    I don't know what I did in my project, but somehow my scale of time lag between my rule of measure.

    The time remains just 0:0 until the playhead reaches 20 Bar of the project then starts counting from 0 there.

    Can someone please tell me how this happens and how to reset so the time progressive count between 0 seconds starting at 1 Bar (instead of starting at 20 Bar as shown)?

    Thanks in advance!

    See below... This should solve your problem...

  • How to reset a timer each time the function is called?

    Hello

    I have my code like below. The main function is called whenever the event occurs. The event occurs when I created a timer which occupies 10 seconds for display purposes.

    Once the Main() is called, a message appears and after 10 seconds, the message disappears.

    The problem I had met with this code is that the message does not last for 10 seconds when the Main() is called consecutively. For example; when its name for the second time within 10 seconds, the display will show for 6 seconds and maintain the reduction.

    Can someone help me with this problem and tell me what to do to reset the timer each time the Main() is called. I also used FeatureState_Timer.reset (), but it did not work.

    / * Declarations of global variables * /.

    public var FeatureState_Timer : timer = new Timer (10000);

    / * Global function * /.

    function Feature_Timer_Function(timerEvent:TimerEvent): void

    {

    Message.Visible = false;

    Feature_Timer. stop();

    }

    function Main(event:Event):void

    {

    FeatureState_Timer .addEventListener (TimerEvent.TIMER, Feature_Timer_Function);

    FeatureState_Timer . Start();

    Message.Visible = true;

    }

    Thank you!!

    Try to reset the timer first:

    function Main(event:Event):void

    {

    FeatureState_Timer . Reset();

    FeatureState_Timer.start ();

    Message.Visible = true;

    }

    If this does not work, use the following code:

    function Main(event:Event):void

    {

    FeatureState_Timer = new Timer (10000);

    FeatureState_Timer.addEventListener (TimerEvent.TIMER, Feature_Timer_Function);

    FeatureState_Timer.start ();

    Message.Visible = true;

    }

  • How to reset the time on my iPad?

    How can I st the clock on my iPad?  I can set the clock of the world, wake up, the timer, but not the time that appears at the top of the screen.  My iPad is not operated by a satellite.

    Settings > general > Date and time. -AJ

  • Why my time to send an hour ahead of the actual time and how to reset it?

    When I send an e-mail message, the timestamp is an hour before the actual time.

    How to reset the time?

    You need to reset the time zone of your email account by going to the settings... option or you must be selected your country, city and code postal correctlly... & that is the question of the email provider... For more information I suggest you the e-mail provider is better, th...
    You can check in comparison with any other provider of messaging (e.g. Gmail or yahoo mail)... If your email provider is not helpful, you can always write it here...

  • How to reset the date on a HP Officejet 6600 on Windows XP

    How to reset the time on a HP Officejet 6600 on Windows XP

    Hello

    Below are the steps to set the Date and time for your device:

    1. On the Control Panel, press the right arrow button and then press Setup.
  • need to reset the timer if away for a minute

    How to reset the timer, a kind of computer is not locked down so fast when I do one not far away.

    Check the Power Options options and screen saver

  • How to reset the date and time

    The year and the time is more correct then faxes be recorded accurately.  How to reset these?  It's my 8600 Officejet Pro.

    Thank you... it was driving me crazy and I couldn't find it on the indices to help HP.

  • forgotten that my bad startup password 3 times computer laptop reboot how to reset

    forgotten that my bad startup password 3 times computer laptop reboot how to reset

    Hello

    In this case, you can use windows system restore to return the machine to a point in time before this prompt syskey occurred using the following method.

    Use another PC to create a Windows 7 repair CD.  Download the ISO from the link below.

    Windows 7 64 bit

    You must use an app like ImgBurn ( Note: you can deselect additional software during installation of ImgBurn options) to burn the ISO to a CD - a guide on the use of ImgBurn to write an ISO on a disc is here.

    Once created, type away at the esc key when you launch Notepad to open the Start Menu.

    Insert the CD to repair.

    Select the Boot Manager option ( f9 ).  Use the arrow keys to select the CD/DVD drive and press ENTER - if you are prompted to "press any key to continue...". ", do.

    Select 'Repair your computer' and follow Option 2 in the guide here to run the Windows system restore - choose a restore point at least 48 hours before the opening of session problem occurred.

    Kind regards

    DP - K

  • How can I reset the time

    Hello

    The function of the program was to indicate the elapsed time. When the program has been run and the switch set to true, the indicator showed the elapsed time. And then move the button to false, the stop indicator to indicate the elapsed time. How can I reset the time elapsed to indicate the time elapsed since 0 when the button switch again without pressing the button "stop"? The program is attached. Thank you.

    From your description, it seems that your code is way too complex. -What are you really trying to do?

  • How can I reset the time and date on Windows Vista?

    How can I reset the time and date on Windows Vista

    http://www.ehow.com/how_2056384_change-date-time-Windows-Vista.html

    http://www.Vistax64.com/tutorials/114989-date-time-change.html

    Read the information in one of the links above.

    See you soon.

    Mick Murphy - Microsoft partner

  • Help: How do reset you default values for the session and the time-out at the admin level

    Hello

    The DBA was trying to save the settings of time-out value by following the instructions and it kept him setting a default off 28800 timeout of Session Timeout and Idle of 3600.

    He saved the value 1, and now we cannot get to change.

    How do reset you the default preferences?

    Bill,

    Sorry, I missed your point. To undo this damage, try this:

    Connect as SYS

    ALTER session set current_schema = apex_030200
    /
    wwv_flow_platform.set_preference (p_preference_name-online 'MAX_SESSION_IDLE_SEC', p_preference_value-online 3600)
    /
    wwv_flow_platform.set_preference (p_preference_name-online 'MAX_SESSION_LENGTH_SEC', p_preference_value-online 28800)
    /
    Commit
    /

    Adjust 3600 and 28800 as you like.

    Scott

  • How to reset the lost password admin

    How to reset the password for the admin on my mac?

    Restart your mac and hold ⌘R immediately. Keep until the Apple Logo appears. This may take some time for your mac start. Once this is the case, select Terminal in utilities > Terminal to the Menu bar above. Once the terminal appears, type

    ResetPassword

    A password reset Wizard will appear. Select the appropriate account, and enter the new password. Then tap Save. Then, click the apple logo in the corner, and tap on choose Startup disk. Click on Macintosh HD and press ENTER.

    You should now be able to use your new admin password.

    Good luck.

Maybe you are looking for

  • Fonts problem

    Dear Sir.I use Windows 7 as operating system. I'm a regular Firefox user for a long time. Recently I have 5-6 families installed fonts Helvetica, off those we were HelveticaNeue-BoldOutline, it's type of contour of police. After installation of this

  • Find the email Skype username

    I'm in a class to develop an android application that allows to use Skype. The question is, most users will not know their Skype name. The users in question will call other users with questions and will soon be Skype. Is it possible to determine the

  • HP Compaq CQ100PC: HP Desktop since Win 10 installed

    Since installing Windows 10, everything works well, with the exception of two points: 1. the system of operating system cannot see the flat screen of HP (HPw1907V) or other scanner HP G3010, recognized. with this PC running Win7 previously. It does n

  • How to record a data type float [64] table in a file?

    I have a table of type float64 [] data I want to save to a file.  I tried to use the ArrayToFile function, but he dislikes the type of data [] float64 .  I'm with LabWindows/CVI version 7.1.

  • Mobile access point settings App metro 8.1 Windows Lenovo

    I installed the application of parameters of Lenovo and used the Mobile Hotspot feature many Windows 8, but now in Windows 8.1 his party.As a reason, I read that this feature is built in point 8.1 of WIndows but I noticed that it isn't possible for 3