5 Replies Latest reply on Sep 10, 2007 7:40 AM by kglad


    jonnybennett Level 1
      OKay does anyone else have any issues with flash?. It is probably my scripting. However if something works 9/10 shouldn't it always work??.
      I have a script that sends data to php and saves it in mysql. 9/10 this script will execute fine, however occassionaly, usually if the php script hasn't been used for a while the data just doens't get saved. Has anyone ever had an issue like this. As I undersatnd it there is no error for sendAndLoad?
      Also I have noticed that on apple mac computers some times my external images are loaded and then after a few seconds simply unload themselves. why??? is this why people never make websites purely in flash... cos they just dont work.
      thanks to any responders.
        • 1. Re: tempremental
          kglad Adobe Community Professional & MVP
          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.

          don't know.

          i've made quite a few websites that are all flash.
          • 2. Re: tempremental
            jonnybennett Level 1
            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?
            • 3. Re: tempremental
              kglad Adobe Community Professional & MVP
              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..."?
              • 4. Re: tempremental
                jonnybennett Level 1
                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
                • 5. Re: tempremental
                  kglad Adobe Community Professional & MVP
                  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.