PDA

View Full Version : So strange...


Ganjart
01-22-2001, 11:10 AM
I have a swf file reading data from a txt file...

When i launch my swf from my desktop,and when it is read with my flash player...i have the perfect file,with updated values on the fly...,everything...

But if i launch whether the html with the swf...or directly the swf,in my browser...i have a non-updated file!!!

i try to refresh my html file...
but nothing does the trick...


what did I miss,where..????

Jesse
01-22-2001, 11:36 PM
Make sure first that the txt file is in the correct directory.
Also make sure that the browser is not caching your text file. Clear your cache before you begin. If you find that it is caching it, then you will need to add an anti-cache mechanism.

Cheers

Jesse

Ganjart
01-23-2001, 08:49 AM
Yes...I actually already checked the caching process of my browser(I think...what could i do to..."counter attack" this ? :))

and my txt file is in the right directory...the same than my swf and my htm....


??

Jesse
01-23-2001, 08:55 AM
To prevent loading from cache you add an arbitrary string to the end of your call on the file to make it unique. That way you never call the same file twice as the browser registers:
file.txt?1234
as different to
file.txt?2345

So what make your loadVariables something like I have in my counter tutorial:

loadVariables ("file.txt?" add random(2000), "/counter");

This way the file will be loaded fresh every time. Note this probably wont work in the Flash player, only through a browser.

Cheers

Jesse