Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

setTimeout doesn't work

Hi everybody,

I'm triying to use setTimeout in my app but it does not work at all.

Here my code.

On iphone sdk 4,2 & titanium 1.2.1

var my_timer = new countDown(0,20,
        function() {
            timer.text = my_timer.time.s;
        },
        function() {

                        label.hide();
                        label2.hide();
                        label3.hide();

                        win.add(notification);
                        //Refresh(data);
            setTimeout('Refresh(data)', 1000);

        }
— asked December 6th 2010 by Alessio Demonologo
  • settimeout
2 Comments
  • Alessio

    You have not provided your mobile platform and Ti SDK version.

    — commented December 6th 2010 by Paul Dowsett
  • tnx, done

    — commented December 6th 2010 by Alessio Demonologo

2 Answers

  • For me this working

    setTimeout(function()
    {
       Ti.App.fireEvent('hide_indicator');
    },10000);
    
    — answered December 6th 2010 by Antonio Silveira
    permalink
    0 Comments
  • setTimeout is working for me also - it looks like you've got setTimeout embedded a few functions deep in your code. It might be worth isolating setTimeout in a simpler example to verify that/how it works, and then start stepping through your code to see at what point your logic breaks down.

    — answered December 6th 2010 by Kevin Whinnery
    permalink
    1 Comment
    • it is possible that i have other interval running and for this does not work?

      — commented December 6th 2010 by Alessio Demonologo
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.