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.
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?
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.
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.
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
Re: Problem Updating Scores
Yes, it gets the correct value. I keep my PhpMyAdmin open all the time when testing.
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)
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.
Re: Problem Updating Scores
A ding is just a sound to make sure the event is being triggered when you think it is.