Cocoonjs Textbox workaround

0 favourites
  • 8 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Since cocoonjs cant render form items

    I read a workaround using the Cocoonjs object keyboard text input

    somehow can be used.. my problem is to post the player name to highscore

    please see my dump here

    the form input = txtPlayerName_input work with the ajax

    So how do get it to work with the Cocoonjs object

    <img src="https://dl.dropboxusercontent.com/u/22406377/Cocoonjs_textinput.jpg" border="0" />

    Regards

    Flemming

  • Global Variable PlayerName=""

    Add condition:

    -CocoonJS on input ok

    Add Action:

    -Set PlayerName to CocoonJS.InputText

    then when ajax-ing, use PlayerName.

    Should be what you want.

  • Thanks for reply !!

    Can you help me with the ajax-thing ?

    savescores.php?name=" & txtPlayerName_input.Text & "&score=" & Score

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • In CocoonJS they don't support textbox. So the textbox object is not created. So instead of using textbox.text, change it to PlayerName variable.

    savescores.php?name=" & PlayerName & "&score=" & Score

  • Great.. thanks again

    It works... but the input window on the phone dont close after hitting OK

    it clear the textfield and I have to hit OK 2 or 3 times

    and it seams to post the extra hits as you can see

    <img src="https://dl.dropboxusercontent.com/u/22406377/Screenshot_highscore.png" border="0" />

    Am I missing something ?

  • Touch is touching will trigger every tick. so it will call the prompt a few times.

    Change your "Touch is touching" to "Touch on touched object". For both Submit and txtPlayerName.

  • Ohh Yes I see ... Thanks :-)

  • Heyy .. Glad you helped me out here :-)

    I has another issue - How do I avoid that a player post more than one time

    Peter 550

    Peter 420

    But only shows once

    Peter 550

    Have a nice day

    flemming

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)