director/shockwave help
- Started
- Last post
- 9 Responses
- drzoom
does anyone know if it is possible to clear a file imported with preloadNetThing from memory?
I am loading a txt file which changes content after the first time it is preloaded - if its loaded a secondtime it loads the content from the 1st preload (hope you know what I mean)
Also, this is in shockwave, not a projector.
- hahakid0
I'm no Director master, but have you tried adding a random number after the url
like
sourceURL = "http://www.test.com/file.txt"url = sourceURL + "?randomNum=" + random( 999999 )
or something ?
it's what I'd do, not sure it'll work but it's better than nothing.
- drzoom0
hmmm... if I understood you correctly it would then preload e.g. "http://www.test.com/file
.txt72832" ... but that file doesn't exist, so it won't preload anything?I'm kinda looking for a "unloadNetThing" command, except that this doesn't exist.
- drzoom0
... stupid me - I should never believe what they are writing in Director help - clearCache does actually work in shockwave.
sorry, I should have tried that first
- nd0
has to look like this:
.txt?72832
you forgot the ?
by using a random number after the ? your text file is downloaded from the server every time you request it, and not from the cache because the file with its random query can't be found in the cache.
- hk_dwayne0
you could do two things (and Im rushing out the door so this is kinda brief.....) but
a) use lingo to reset the content of the cast member to " " or something (poor mans way of blanking out the content!) or
b) using Director's unLoadMember() command (see the help function for more...)
Happy Lunar New year to all!
lates!
- drzoom0
I tried the ? & random number after the url ... but then it still won't find the file :(
clearCache doesn't seem to be the ideal solution either.
- nd0
try
theRequest = "www.yoururl.com/yourfolder/your...
where 823746 is either a random number or the ticks
theNetResult = getNetText(theRequest)
then do the netDone() thing
i am using getNetText instead of preloadNetThing, but preloadNetThing should work, too.
- drzoom0
...nope - still won't load it.
- drzoom0
oh well, I give up, I'm gonna stick with clearCache for now, till I think of something better.
Thanks anyway, nd