This content has been marked as final. Show 10 replies
It's probably being cached by Director. You can fool Director by
supplying a unique parameter to the request (which your server will
tempURL = " http://www.MYWEBSITE.com/ClientListImport.txt"
tempURL = tempURL & "?i=" & _system.milliseconds
Sean, thanks for the quick reply, but it doesn't seem to be working. I've even tried something similar where I would set tempURL to something else, then back to the location of the textfile, but it still wouldn't work.
EDIT: I had to edit out some stuff from my previous post because I ran across some new info that contradicts what I had posted.
Anyways, I actually did get the cast member to update it's text values from within Director by using the code below, but (of course), while the cast member had been updated with the values from the temp text file, once I tried to reimport the original text file (which I updated), it still brings in the old text.
So it appears that Director is caching the text from the URL (in memory) and no matter what I do to get the text again, it won't do it and uses what is currently in memory.
It seems like I need to get it out of memory first before grabbing the newly updated text again.
My advice would be, instead of using importFileInto(), to issue a
preloadNetThing() against your ("uniqued") URL, wait for it to finish,
then set the filename of your member to the URL.
Or, since it's a text file, use getNetText(), again wait for it to
finish successfully, and set the text of your member to the
You didn't say what event is meant to trigger the loading of the file, but
the script at
will do it when attached to something you click on.
quote:I am running a projector file on a PC that displays our clients for that day...since this computer is hidden from site, it's difficult to update the list every morning without breaking the keyboard and mouse out from behind the storage area - (a real pain in the butt)...
Originally posted by: Newsgroup User
You didn't say what event is meant to trigger the loading of the file,
What I currently have running is, a text file (which contains all of the current clients names) that gets imported into the projector (upon launch) so the receptionist can easily just edit the text file and rerun the projector every morning.
Since the computer is hard to get at, what I'm trying to do with the text file is put it on the web and use a PHP script to write the new values to the text file (which I have successfully done)...Then, have the projector import them in everytime it loops through it's animation. This way, no one needs to get into the display computer - we can update it from any system that can access the web.
So all I really need is a way to import the text file, but then have the ability to re-import any changes to the text file after it's been updated via the web site. Right now, the changes to the text file won't update in the projector unless I exit out and rerun it. Since this means breaking out the keyboard and mouse again, it defeats the purpose of having the text file on the web site.
Andrew, I will look into the link you posted, but it looked confusing to me as to how to implement it into my project.
Sean, I will look into the getnettext script, but I'm not 100% up on scripting, so any help would be appreciated.
Again, the code below is what I am currently using to import a text file into the cast member "ClientListImport":
Well, I tried the getNetText() method and it still doesn't get the updated text from the web. The new code I am using is attached below.
The other interesting thing is, this:
1) I open the program into Director
2) I run the timeline (causing the text file to be imported)
3) I stop playback in Director, but don't quit out.
4) I upload a new text file (to the same URL location) with different values
5) I go back into Director and delete the text from the cast member "ClientListImport"
6) I then run the timeline again, and it imports the "old" values back into the cast member.
Director does appear to be caching the text file in memory and won't allow any new values in unless I exit out first.
> tempURL = getNetText(" http://www.MYWEBSITE.com/ClientListImport.txt")
Again: you need to add a dummy query string so that Director doesn't use
a cached version
netID = getNetText(" http://www.MYWEBSITE.com/ClientListImport.txt?id=" &
> if netDone(netID) then
> member("ClientListImport").text = netTextResult(netID)
> end if
Be aware that you have to loop on a frame waiting for netDone to return
TRUE before accessing the netTextResult(). It's possible it's "failing"
for you because you skip right past the netTextResult because netDone is
-- #movie script:
tURL = " http://www.MYWEBSITE.com/ClientListImport.txt?id="
tURL = tURL & string(the milliseconds)
gNetID = getNetText(tURL)
if netDone(gNetID) then
if netError(gNetID) = "OK" then
member("ClientListImport").text = netTextResult(gNetID)
-- propagate whatever other changes are required
alert "Error reading text file:" && netError(gNetID)
Sean's code should do what you need. For completeness sake, you can
also try to use the clearcache() command to clear out the cache.
Thanks again Sean, that script worked.
What I also had to do was implement it into a frame script as well so that it would update over and over again. I also combined that with Mike's clearcache() command - Thanks Mike, I was looking for something like that.