PDA

View Full Version : very basic question: help appreciated!


mmeagher
08-31-2001, 10:39 AM
I am calling a php script from a flash animation on mouse over, and need to access fresh data with each call to the script. Due to the browser's caching function the script only gets called on the first mouse over.

Is there a way to send a time stamp or random number to the script with each call to trick the browser into calling the PHP script each time? I suspect this is a very basic question, but I can't seem to get anything to work.
I'm using the getURL command to call the script. I think my question comes down to: what is the syntax for sending multiple variables using getURL?

The relevant script is simply:

on (rollOver) {
getURL ("my_query4_roll.php?value="+32,"mydata");
}

I have tried multiple variants on this for sending the additional variable(s), such as:

on (rollOver) {
getURL ("my_query4_roll.php?value="+32"&myrand="math.rand(),"mydata");

Any assistance would be much appreciated.

Jesse
08-31-2001, 11:01 AM
please remember to search using the 'search' button before posting. we've coverred this often. search "noCache". you just have to add a random string basically.

mmeagher
08-31-2001, 12:55 PM
Sorry about that: I have found the noCache postings.

I'm still wondering, though, how one appends multiple variables to a script or URL in Flash using getURL.

I've been trying variations on

script.php?myvariable1=hello&myvariable2=helloagain

but without success.

Again, sorry for what must be an unbelievably basic question, but I've been searching the forums and haven't found an example that appends many variables to a URL/script.

[Edited by mmeagher on 08-31-2001 at 07:11 AM]

Jesse
09-01-2001, 04:55 AM
The fastest and easiest way is:
getURL ("file.php", "", "GET");
This will auto-append all your variables in get-form (URL visible). You can also replace "GET" with "POST" which will not show the variables in the URL. To make a dynamic call using GET you need to create a _root.level variable with a random number in it:
_root.myRan = random(10000)+random(999999);
this way you variable will be auto appended to your call string, which should give you a uniqe call each time you update the random variable.