facebook

Javascript to create a custom splash screen: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #330433 Reply

    appmos
    Member

    I´m using this code:

    setInterval(function(){phoneui.gotoPage('screen2', FADE)},3000);

    But not works. What´s wrong?

    Thanks

    #330435 Reply

    Hi appmos,

    Please try replacing by this:

    setInterval(function(){phoneui.gotoPage('m1-screen2', "FADE")},3000);
    
    #330437 Reply

    appmos
    Member

    Hi Octavio.

    The screen has not changed. I’ll see the result on the test center, right?

    Thanks

    #330438 Reply

    Hi appmos,

    >The screen has not changed. I’ll see the result on the test center, right?
    Yes, you will see it there.

    Q: are you adding your “scree2.mobi” as an additional project file? If no, please do it. ( See http://www.genuitec.com/mobile/docs/highlights/current/#sec4a )

    #330439 Reply

    appmos
    Member

    I added the screen but still does not work. Now I see the background image of the screen2 in splash Screen2

    Code:

    
    <script>
    function splash()
    {
      setInterval(function(){phoneui.gotoPage('m1-screen2', "FADE")},3000);
    }
    </script>
    
    body onload="splash()">

    One doubt> I need to add the screens in my first screen (splash screen) right?

    #330445 Reply

    Hi appmos,

    To avoid modify the generated html file, I suggest you put the code above on the phoneui.documentReadyHandler function in custom.js file.

    #330465 Reply

    appmos
    Member

    Hi Octavio

    I do not know how to include the code on this page. Could you help me?

    Thanks

    #330485 Reply

    Hi appmos,

    You can use either any text editor or the one is included within Test Center. See http://www.genuitec.com/mobile/docs/workingWithGeneratedFiles/workingWithGeneratedFiles.html#editing_javascript

    #330487 Reply

    appmos
    Member

    Hi Octavio

    I don´t know how the code should be.

    In this way?

    phoneui.gotoScreen('contacts-screen', 'FADE')
    #330489 Reply

    Hi appmos,

    According next doc I suspect the name to call your second screen is m1-contacts_screen. So your code should be something like this:

    setInterval(function(){phoneui.gotoPage('m1-contacts_screen', "FADE")},3000);
    
    #330505 Reply

    appmos
    Member

    So just like the function I had prepared in html.

    It worked, but the other application screens are also being affected: when access another screen after 03 seconds returns to the screen that I determined in the code.

    What should I do so that only the splash screen go to the main screen?

    Thanks

    #330532 Reply

    Hi appmos,

    You can try with setTimeout() with this your function will be called only one time.

    setTimeout(function(){phoneui.gotoPage('m1-contacts_screen', "FADE")},3000);
    

    Let me know how it goes for you.

    #330534 Reply

    appmos
    Member

    Great! It worked very well. Now there is the possibility of generating splash screen for Android too. Thank you, Octavio.

    #335933 Reply

    badal405
    Member

    You can use either any text editor or the one is included within Test Center. See http://www.genuitec.com/mobile/docs/workingWithGeneratedFiles/workingWithGeneratedFiles.html#editing_javascript

    Hi Octavio,
    I follow the above link and write the code as
    setInterval(function(){phoneui.gotoPage(‘LoginForm.mobi’, “FADE”)},3000);
    just above of
    phoneui.documentReadyHandler = function() {

    }

    but still not working. BTW, i have two separate screen not page. So “gotoPage” is it the appropriate function for open new screen?
    Waiting for your reply.
    Thanks and regards.

    #335934 Reply

    badal405
    Member

    @appmos wrote:

    So just like the function I had prepared in html.

    It worked, but the other application screens are also being affected: when access another screen after 03 seconds returns to the screen that I determined in the code.

    What should I do so that only the splash screen go to the main screen?

    Thanks

    Could you please tell me where you have written the function and where you call the function?

Viewing 15 posts - 1 through 15 (of 20 total)
Reply To: Javascript to create a custom splash screen: CLOSED

You must be logged in to post in the forum log in