Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2011

    Javascript timer stops on touch


    I'm developing a game for wrt. And in that game I have a timer which counts the time, spent for each new game. But, there is a problem in timer. When I touch in any part of the screen and hold my finger in there, the timer stops until I hold up. What could be the problem, can you help me on that?

    Here is the code of timer;

    interval = setInterval(function(){
                var totalTime = parseInt($("#total_time").attr("time"));
                totalTime += 10;
                var ms = (totalTime % 100);
                var sec = Math.floor(totalTime / 100);
                $("#total_time").html((sec < 100 ? ((sec < 10 ? "00" : "0") + sec) : sec) + ":" + (ms < 10 ? "0" + ms : ms));
                $("#total_time").attr("time", totalTime);
            }, 100);

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008

    Re: Javascript timer stops on touch


    I would suggest to look for QML if you want to do a simple game, because WRT is not the Optimal environment for games.

    Timers are often paused in WRT. How they behave on case of touch has changed a bit over time.

    -Browser 7.1 touching the screen will not stop timer, but trying to scroll does (touch and move finger)
    -Browser 7.2 Touching the screen will stop the timer
    -Browser 7.3 Same as 7.1


  3. #3
    Registered User
    Join Date
    May 2011

    Re: Javascript timer stops on touch


    I know that wrt is not the optimal platform for a game. But I'm developing just a board game which can be easily developed with javascript. And I want to publish it as soon as possible to see the reactions. So I have developed it in wrt. If the reactions go well then I can think of converting it to qml. But, for now, I have no experience in qml. So that it is what happened

  4. #4
    Registered User
    Join Date
    Jun 2011

    Re: Javascript timer stops on touch

    Are you sure it's the timer that is stopping?
    Isn't just the screen that isn't being refreshed while you're pressing it?

    If the problem is just refreshing the screen, you could play a little with the values for the following functions.
    widget.setNavigationEnabled(false); // true | false
    widget.setNavigationType("tabbed"); // tabbed | none | cursor


    Hope it helps,

  5. #5
    Registered User
    Join Date
    Apr 2011

    Re: Javascript timer stops on touch

    I am facing the same problem please guide if some one have resolved that error.ASAP

Similar Threads

  1. can i simulate Touch/Multi-Touch on Qt Simulator?
    By 7nail in forum [Archived] Qt SDKs and Tools
    Replies: 5
    Last Post: 2011-01-17, 16:31
  2. Replies: 6
    Last Post: 2010-10-26, 17:33
  3. Replies: 8
    Last Post: 2009-10-21, 08:55
  4. Timer stops when process goes background
    By slayv in forum Symbian
    Replies: 4
    Last Post: 2009-02-02, 12:42
  5. Timer task stops
    By tramos25 in forum Mobile Java General
    Replies: 0
    Last Post: 2005-02-26, 00:04

Posting Permissions

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