# Manipulating the Timer

**URL:** https://forum.kirupa.com/t/manipulating-the-timer/330054
**Category:** flash
**Created:** [November 24, 2012, 8:56am UTC](https://forum.kirupa.com/t/manipulating-the-timer/330054 "2012-11-24T08:56:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kazu123](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kazu123](https://forum.kirupa.com/u/kazu123)
#### Post date: [November 24, 2012, 8:56am UTC](https://forum.kirupa.com/t/manipulating-the-timer/330054/1 "2012-11-24T08:56:56Z")

</div>

Hi, I’m trying to manipulate the timer by using buttons which can add or subtract seconds. I can successfully update the myText1 with the updated value but I once the timer starts, the timer gets back to its original value. Someone please help ☹

```auto

var secs:int = 120;myText1.text = timeFormat(secs);
up1.addEventListener(MouseEvent.CLICK, up01);
down1.addEventListener(MouseEvent.CLICK, down01);
timer.addEventListener(TimerEvent.TIMER, countdown);

function down01(event:MouseEvent):void
{
    if(secs>=30){
    secs = secs - 30;
    trace(secs);
    myText1.text = timeFormat(secs);
    
    }
}

function up01(event:MouseEvent):void
{
    if(secs<360){
    secs = secs + 30;
    trace(secs);
    myText1.text = timeFormat(secs);
    }
    
}

function countdown(event:TimerEvent) {
    
    var totalSecondsLeft:Number = (timer.repeatCount) - (timer.currentCount);
    myText1.text = timeFormat(totalSecondsLeft);
}

```
