open a window after certain seconds

You must Login before you can answer or comment on any questions.

Hi all ,

I want to open a window after showing activity indicator for 3 seconds . How can i do that..(Iphone)

ThanKS

1 Answer

Accepted Answer

Use JavaScript function "setTimeout".

— answered 2 years ago by Ivan Škugor
answer permalink
3 Comments
  • doesnt work....

    var actInd = Titanium.UI.createActivityIndicator({
        title:'SLoading',
        height:35,
        width:200,
        top:145,
        style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN,
        setTimeout:300
    });
     
     
    win.add(actInd);

    — commented 2 years ago by mathew orleans

  • "setTimeout" is a function, not property. Here is simple example that shows how it's used:

    var win = Ti.UI.createWindow({
        modal: true,
        backgroundColor: '#000'
    });
     
    setTimeout(function() { win.open() }, 3000);
    So, this code will open window after 3 seconds.

    — commented 2 years ago by Ivan Škugor

  • Thanks ivan :)

    — commented 2 years ago by mathew orleans

Your Answer

Think you can help? Login to answer this question!