Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getNetText quirk?

Status
Not open for further replies.

haffej

Programmer
May 2, 2004
4
US
i'm developing an application that uses getNetText and postNetText for a text file that stores user responses. everything works ... sort of.

two problems:

i open director and play the movie, and when i click on one option it gets text using getNetText. but the first time i play it, it doesn't load any of the text. if i stop the movie, start it over, and click again, it properly reads the text file. why doesn't it work correctly the first time?

also, once it has properly read text, i have the program write additional text to the file. then when i read again with getNetText, it still reads the OLD version of the text file, it doesn't reflect the changes that were saved. before i use getNetText, i make sure the variable i store the text file in is empty. the problem is solved if i close director entirely, then re-open it... (but then i run into the first problem again, of course.) how can i make sure that getNetText actually reads the file every time it's used?

quick replies would be greatly appreciated as i have about 2 days to finish this program =)
 
update:

the first problem has been solved by putting the code into a frame script and if not netDone() then go to the frame

but the second problem remains. i've tried putting a dummy query string at the end of my url to force it to query the server (just like macromedia says to but it doesn't work. i don't know if that's because i have mx 9 and that approach only works in version 6 ...
 
I think you're using the same netID for netTextResult(netID) function so that the result would be the same as the last one as you're retrieving data from the cache, not from the server. Try clearCache command to clear the network cache and make sure unique netID is generated each time.
 
nope, it was using a new netID every time because i was error-checking by putting it to the message window along with netDone and the string that i'm trying to put the text to... so i'd see something like:

1
0
""
2
0
""
3
0
""
etc.

i broke down last night and decided to sacrifice a little flexibility by just importing one of the files (which is static, anyway). from the frame script that repeats until netDone, if it's finished, i retrieve all the info i need, and then i do clearCache. THIS works when i later save more info to the file and then do getNetText. however, i've read that clearCache doesn't affect the user's browser caching -- meaning that when i export this to the web, it will have the problem of retrieving a cached version. correct?

so i'm still looking for ideas.
 
clearCache & cacheDocVerify will not work in Shockwave movie as Shockwave movie cannot clear browser cache.

What you can do is create CGI script, which will return the text, then send a query with unique parameter each time.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top