User Tag List

Results 1 to 7 of 7

Thread: How can I parse GET data from the Get object?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I parse GET data from the Get object?

    Hey, folks!

    I have been working on a project where I have been setting up a "worldwide" online high score system. Thanks to a number of people on this fine forum, I have been set straight from using an INI file to maintain high scores to using a Lacewing Web server and transferring a high score to the Web server.

    I am having a problem understanding how I can parse data from the Web server. For example, when the game starts, a Get object requests GET data from the Lacewing Web server to acquire the existing high scores (each of which has three elements--player name, score, and hit ratio). Since I maintain 10 high scores, the Web server sends 30 pieces of information to the Get object (Player Name 1, Player Name 2, etc.).

    Once the Get object acquires this information, how can I parse it so that it can be displayed by Text Blitter objects on-screen?

    I do the Get object has an expression called "Get requested data." I assume this means all the data (30 pieces of information). How can I parse this (assuming this is the correct method of dissecting the data from the Get object)?

    Thank you very much for your continued assistance!


    Most graciously...

    RGBreality

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    That data is in the same format that your server should have sent. You need to use that expression with the "On Get Complete" condition.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    Hey, LB!

    Just to ensure I understand you... As an example, I had the Web server send data like this (action):

    Add string GetString "Player Name 1" from Named Variable object to response


    So here's my next question: If I use the "On Get Complete" condition, what action do I specify for the Named Variable object (which is identical to the one on the Web server)? I'm used to first loading data into the Named Variable object via an INI or NVO file. Do I essentially use actions like:

    (local) "Player Name 1" of Named Variable object = (Get requested data) "Player Name 1

    (?)

    Thank you (again) for all your help!


    Definitely most appreciatively...

    RGBreality

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    It depends on how you send the scores to the player from the server. How are you sending them from the server? Give an example of the text you are returning.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    Hi folks!

    My setup is slightly different, but my question is also how to parse data from the GET object. So I chose to put my question in this thread.

    My project is built as SWF file. I retrieve a single integer value from an external text file and x-scale an active object according to the received value. This works fine so far. The external text file contains only this one value.

    Now I want to receive y-scale, x-pos and y-pos also from the external text file. The content of the text file for this looks like:

    11
    20
    190
    65

    Always one value per line. I tried to put the content of the file into an array, but I didn´t succeed, because I don´t know how to adress a specific line of the file. I would be happy if you give me a hand on this.

    Regards, padawan

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    For all quesions just use the "string parser 2" object.

    Set a delimiter, like in padawn's case it would be $newline

    Then get the values using getelement$("string parser 2",2) to get element 2 for example.


    Of course if your php script output's the text pre-formatted you could just do this:

    Set string to Retrieved$("get object") <-I'm unsure if that's the exact expression, but the idea is the same.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I parse GET data from the Get object?

    Thanks, UrbanMonk. Took me a while to get it working, but it works fine now.

Similar Threads

  1. Replies: 17
    Last Post: 10th July 2013, 01:46 PM
  2. Parse PDF
    By MJK in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th November 2010, 04:44 PM
  3. xml and & parse
    By bubba_damage in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th January 2010, 11:42 AM
  4. Delayed Parse Setting
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th February 2009, 07:06 PM
  5. Parse a text file
    By kungsangun in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th March 2008, 03:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •