4 Replies Latest reply on Dec 16, 2006 6:53 PM by LucaLT

    Auto refresh advice


      I have a 1 frame app that display data from mySQL. I want to implement an auto refresh capability. I came up with 2 ideas:
      either use a setInterval function or just add a frame. In terms of performance and efficiency what would be the best option? Are there better ways I can accomplish this?
        • 1. Re: Auto refresh advice
          kglad Adobe Community Professional & MVP
          how often do you need to refresh the data from your data base? (and making a two frame movie even playing at 1 fps isn't going to work.)
          • 2. Auto refresh advice
            LucaLT Level 1
            I was thinking about every 2 minutes.

            EDIT: I just read better your post. 2frames is still too fast for flash to retrieve the data?
            • 3. Re: Auto refresh advice
              kglad Adobe Community Professional & MVP
              2 minutes should be ok. using a 2 frame timeline that queries your data base every other frame would result in data base calls, at least, every 2 seconds and that would not work. you'd be sending a query before the previous had completed.

              you can use setInterval to call a function every 2 minutes that queries your data base. you'll use something like:

              • 4. Re: Auto refresh advice
                LucaLT Level 1
                Thanks, at the end I used setInterval. I mostly was concerned about performance and overall reliability, I just wanted to make sure to choose the right method. On a more general basis, what would you reccomend when writing dynamic apps? Is setInterval a common method or are there more specific ways to deal with dynamic content?