Madsoggytoast's Recent Forum Activity

  • Hello Madsoggytoast, in case you need help on this topic, I published a tutorial.

    It uses JavaScript. You may also include any other API using this technique!

    Link>>

    Thankyou.

    Excellent! Nicely done, and this will be very useful. Will I have to add any additional JS Variables to create other DB tables/rows or can I do this inside C3 and write to the DB?

    Thank you.

  • github.com/rexrainbow/C3RexDoc/tree/master/repo

    It looks like this link is no longer there. :/ github.com/rexrainbow/C3Plugins

    Has anyone else tested this? I'm deciding whether to make the leap to C3 from C2 or wait a bit longer. Anyhow thank you everyone.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm having a hard time with adding JSON data into a variable. My goal is to have a simple list of rows of data. These would be shown as a variable. and then set the text as that variable. Bear in mind this is intended to be an app that syncs up with a website showing the same data which is hwy I am using JSON and AJAX.

    Where I get lost is adding the AJAX call to JSON from a webservice into the variable or text. It doesn't get parsed right. Any help, examples, or capx examples would help immensely. Thanks.

  • Awesome, thank you dop2000. Any recommended tutorials on how to use this? I'll probably be looking over the forums here.

  • Well, that worked for the token, but it got more complex on me and pardon my knowledge of setting Arrays in construct 2 is not the greatest.

    This JSON has more data to store on the Y I believe in an array. see image below:

    My array is set up like this:

    However, I cannot get it to store the Y. I'm doing something wrong I know. width of the array is 5 at the moment.

  • Thank you for the help. I now wonder if I will run into problems writing back to the webservice end point with this method. Essentially, I need to read and write data from a server (PHP). This app needs to work along side a website and I'm getting JSON data for reading/writing. Thanks dop2000 though, this is a good start. (This project is reminding me why I prefer firebase).

  • Note* I've tried using "," as my data seperator but I still have unecessary characters in the arrays. :/

  • Thank you sizcoz! This helped as I see it seperating data, but it is not seperating the data exactly how I need it. Is there a way to make the string parse more data seperators? Or perhaps there is a better way to parse what comes back. Here is what I receive from an AJAX request:

    {"token":"000000000000000000","privatetoken":"1111111111111111111111111111"}

    Below is what I get from setting the X element to the array using tokenat and AJAX last data.

    Thank you.

  • Okay, so I am looking everywhere to figure this out and with no such luck. I'm trying to grab a login token with AJAX. See screenshot below. How would I go about getting AJAX to seperate AJAX.lastdata into variables for later use?

    After this, my global variable returns:

    What I need to do is assign this as a variable. I'll have other AJAX calls as well. I'm not sure how to separate this data. AJAX.LastData returns quite a bit, I want to use only part of this in a variable for instance the "token" variable could have the corresponding value.

  • Hello everyone. I have been scouring over forums and no luck with what I am trying to do.

    My goal is to have a login system on an app built with C2 and eventually need to read/write to make the app sync to the web version of the app that is already built using various web endpoints. I think using AJAX requests to json data will work but I cannot seem to parse the data to get the key and values of JSON data into a variable.... I'm getting the whole string as a variable which doesn't help.

    EVENT 1: on login button clicked AJAX request: "/token.php?username="&Username&"&password="&Password&"&service=mobile_app"

    (This part is functional) and I get back a long string set to a variable as follows {"token":"long string of numbers here","privatetoken":"longerstring of numbers here"}

    From what I gather, I need to get this information into an array, so that I can check to see if this token exists. If it doesn't exist I get this: {"error":"Invalid login, please try again","errorcode":"invalidlogin","stacktrace":"* line 104 of \/login\/token.php: exception thrown\n","debuginfo":"\nError code: invalidlogin","reproductionlink":"https:\/\/website.com\/"}

  • Yes, that works, and makes sense. Thank you very much! Now I'm on the right track... I just need to figure out how to connect up to an existing mysql database which seems to be a daunting task.

  • I'm trying to build an app in which users can select from the options on a drop down and get placed on a new layout, showing their entries (User Specific). I have the dropdown text boxs working with some conditional logic. However I am unsure how to string the selections into an entry that prints out text onto another layout. Eventually I'll want to be able to have an admin edit the entry if needed or delete, but for now just getting this far is enough as I'm familiar with local storage or (more than likely) serverside scripting with a DB.

    Anyhelp is much appreciated, thank you.

Madsoggytoast's avatar

Madsoggytoast

Early Adopter

Member since 20 Aug, 2017

None one is following Madsoggytoast yet!

Trophy Case

  • 7-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies