User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Problem Updating Scores

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem Updating Scores

    Hi!

    I can't get this to work. On start of frame i use Live Receiver to get the users balance via PHP and MYSQL, and on Received i add the balance to the counter. Next when the button is clicked i use Live Receiver to update the balance by lets say 5, then the counter displays 0 time and time again, but the balance has been successfully updated by 5. So i have to restart the application to see the changes on the counter.

    Does anybody know how to refresh the counter to display the updated number in realtime? This works fine if im not updating via Live Receiver and only use Add to counter or Substract from counter. But this game needs to update both at the same time.

    As always i appriciate very much all of your help.

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem Updating Scores

    What happens if you simply add to your counter after you recieved the data from live receiver?

    live reciever gets the current balance
    application adds to the counter and the current balance
    live reciever sends the new current balance back to the server

    Or maybe I don't understand what your trying to do.

  3. #3
    No Products Registered

    Join Date
    Dec 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Updating Scores

    Thats what i do, on start of frame i add the currect balance to the counter when data is received.

    But the problem is when i send a request to update the balance the counter displayes 0, it should display the newly updated number. I have to restart the application or frame for the counter to display it, and this should be done in realtime.

    Like this: The player loses and i substract 5 from the counter and at the same time i send a request to update the score so it also effects the data in MYSQL.

    I don't know, maiby i have to do it in different order?

  4. #4
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem Updating Scores

    Perhaps you need to add data to the counter after the recieved data is processed? Its hard to say without seeing your events or application but something must be happening in the wrong order or before the recieved data can be processed.

  5. #5
    No Products Registered

    Join Date
    Dec 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Updating Scores

    I tried to add data before and after but that diden't work. And have also tried many different orders.

    Here is the code, very simple stuff:

    +Start of frame
    ->Start downloading from "http://www.mywebsite.com/get_balance.php

    +Data received
    ->Set counter to Val(Received$( "Live receiver" ))

    +Button clicked
    ->Subtrack 5 from counter
    ->Start downloading from "http://www.mywebsite.com/update_balance.php?balance="+Str$( value( "counter_balance" ) )

    Then after i click the button the counter displayes 0, it should display 95.

    I guess it cant update in realtime when i use Live Receiver? Or i it cant send 2 requests and receive 2 things in one frame?

    It's really stupid jumping to another frame and back in a middle of a game to display the updated balance.

  6. #6
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem Updating Scores

    Does your update_balance script return the correct value when you type it in your browser directly?

    Try typing it in
    http://www.mywebsite.com/update_balance.php?balance=95

  7. #7
    No Products Registered

    Join Date
    Dec 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Updating Scores

    Yes, it gets the correct value. I keep my PhpMyAdmin open all the time when testing.

  8. #8
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem Updating Scores

    I might put a ding on the data recieved event to make sure something is coming back the second time.

    but without seeing the app in action I don't know what else to advise. I have done different calls in one frame but I did group my code well and used different data recieved events.
    (Simple because I wanted to do different things with the returned data)

  9. #9
    No Products Registered

    Join Date
    Dec 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Updating Scores

    What is a ding? That might work.

    There is no reason seeing the app, and i dont want to show it off
    to the entire internet. I have just the code i showed you for this frame for now, nothing more.

    There must be something stopping the data form comiming back the second time.

  10. #10
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem Updating Scores

    A ding is just a sound to make sure the event is being triggered when you think it is.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. A complicated problem with scores and savefiles
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th January 2012, 06:10 PM
  2. Updating high scores in an ini+
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 27th June 2010, 07:25 AM
  3. Problem updating !
    By den333 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th March 2010, 11:55 AM
  4. Problem Updating
    By JamieZ in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th May 2008, 11:14 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
  •