This content has been marked as final. Show 5 replies
alot of people have issues using flash, but that doesn't mean it's a flash issue. the same can be said of any programming language/environment.
not necessarily and in your case, no.
i know of no issues with sendAndLoad() when use DIFFERENT loadvars objects for the send and the receive.
i've made quite a few websites that are all flash.
Thanks Kglad for the response. I am using diff loadVars to send and recieve the data.
My website is purely in flash. It communicates with a mysql database using php. However if a php script that sends data from flash is to be saved in mysql hasn’t been used for say an hour, then when you first go to use this script the data doesn’t send.
I assume that there is some kind of delay that is happening between the sending of the data from the flash to php. I don’t know whether this ’delay’ is occurring from when the user submit’s the data to be saved or whther the server recieves the data ok but takes to long to find the php script and the data is lost… either way this is a huge problem.
I think it is the later as the problem seems to only happen when a php script hasn’t been used for a while and therefore isn’t in the servers ram?
Do you think it is possible to keep all my php scripts in the server cache at all times to solve this I assume ‘delay’ that is causing the flash and php communication to faulter?
Is there a better safer way to send data from flash to mysql?
your php script shouldn't be cached, at all.
and there is a delay between the execution of the flash code that calls the php script and the completion of your php script. that delay should only be 1 or 2 seconds unless there's a lot of data being transmitted. and you should be coding so that delay causes no problem.
sending data from flash to mysql via php should be ok though i don't know what you mean by a "...safer way to send data..."?
Thanks for yorconitnued help. When I say safer, I just mean so that this loss of data that is happening on some occassions doesn't occur.
You mentioned... 'and you should be coding so that delay causes no problem.'
Can you give me an example of what I should be doing so that the delay causes no problem. I already have my php to echo an error message if the sql in the php doesn't execute but the error is still occuring on the odd occassion. I would understand if the problem happened every time, but it just happens occaisionally.
I am also thinking now that it may be my flash that is causing the error. I have a few on enterFrame animations going on at the time the user submits their data... could this in any way effect the speed / way in which flash sendAndLoad data to my php? Thanks again. J
no, your enterframe loops shouldn't cause a problem for your LoadVars' statements once they start to execute. the LoadVars' statements could cause your enterframe loops to stutter but even that's not likely.
coding properly for the asynchronous nature of the LoadVars sendAndLoad() method only requires an onLoad or onData method of the LoadVars object to handle the returned data from the php script so nothing in your code, that depends upon successful writing to your mysql, executes until that onLoad or onData method is called.