A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: reload variable from text file

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    27
    i'm loading a variable from a text file on the server.
    that variable in that text file is subject to change.
    the problem is that the flash file gets cached by the web browser BUT SEEMINGLY ALSO the variable of the text file on the server.

    this means that when i changed the variable in the text file, the variable won't change in my flash file because the old one is cached by the web browser.

    how can I ressolve this?

    now i'm using:

    loadVariablesNum ("welcome.txt", 0);

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    try this:
    oadVariablesNum ("welcome.txt?stuff="+random(999), 0);

    Musicman

  3. #3
    Junior Member
    Join Date
    May 2001
    Posts
    27

    Smile

    thanks musicman!i'll check it out asap!

  4. #4
    Junior Member
    Join Date
    May 2001
    Posts
    27
    cool. it works. thank you very much!

  5. #5
    Junior Member
    Join Date
    Nov 2001
    Posts
    27
    Please explain why this works.

    Good solution, but I like to know what I'm doing and why


  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    if you call this a few times, the browser will see requests for
    movie.swf?stuff=23
    movie.swf?stuff=341
    movie.swf?stuff=47
    etc. It will still cache them, but it believes they are different. You could also use the current time instead of the random bit....

    Musicman

  7. #7
    Junior Member
    Join Date
    Nov 2001
    Posts
    27
    Got it!

    Many thanks.

  8. #8
    Junior Member
    Join Date
    Dec 2001
    Posts
    1

    did not work

    hey I just used this but did not work what is wrong?
    loadVariables ("http://localhost/db/chat.txt?ran="+random(100), 0);
    this did not work. no error messages but did not work is anything wrong? What should I do exactly?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center