PDA

View Full Version : Caching issue with MX <--> SQL DB - LoadVars object using cached data


funkmasta55
09-16-2002, 11:30 PM
Hello,
I am working on a project which involves an administrative interface where the administrator will be able to Add cities to a map, and attach their franchise business locations to those points.

When the movie loads, the admin is shown a map on the left with available states, and a Combo box is populated with this info as well.

Then the admin will select a state, and the map zooms in to say "Colorado", and the current city locations are populated from the DB using duplicate MC and placed with X and Y coordinates. Say "Denver", "Colorado Springs", and "Aspen"

Now, the admin can click on "Add Location" button, and a new draggable location dot is placed on the screen. The administrator names the new city dot "Fort Collins" - they drag the dot to the appropriate location, and submits the info. The dot name, X and Y coords are stored in the server.

-- On submit, the labels are cleared, the server waits for a response from the script (so it knows the DB has been updated) and I run the function to RE-LOAD the label info from the DB so the user can see the new city they just added.

function loadLabelsFromDB(stateID){
myLabels = new LoadVars();
myLabels.onLoad = addLabelsToStage();
myLabels.load(Return_State_Labels.asp?stateID="+stateID);
}

For some reason, the new label is not read back into my movie until I CLEAR THE CACHE! which is a pain in the ass...

QUESTION: Is there a way to clear the LoadVars() object?

It seems like it is caching the URL string that the server/ASP script passes back with the data!
I thought I was clearing the LoadVars object when I call the function again????

ALSO - the strange thing is, when I am working out of the Flash Publish mode (ctrl+Enter in Flash) everything updates/works correctly - the problem only occurs when I am working with the movie on the server.

QUESTION: Why does this only work from my machine, not the server???

Thanks
FH

zoomfreddy
09-17-2002, 08:37 AM
try adding a random number var in the asp response so flash see it as a new call...

or make the loadvars call witha random number var after the name of the file as:

"Return_State_Labels.asp?stateID="+stateID+"random="+Math.random()*9999

one of this have to fix the problem...

:cool:

o0JoeCool0o
09-27-2007, 01:35 AM
im having the exact problem as funkmasta adding nocache random number doesnt help cause for some reason its not posting the updated post string if i trace the post string i can see the random number change but on the response back i get the data that was cached!