PDA

View Full Version : loadvars.send TARGET problem


gromit
04-02-2003, 11:46 AM
Hi all

I recently produced a high score table for a game (seems to be a common thing in this forum!) - it uses loadvars LOAD to access a bit of ASP to drag in the top 5 scorers, and this works brilliantly. I use loadvars SEND to send the user info to the database via another ASP page - and this too works perfectly.

BUT!

When I run the loadvars SEND it always targets a _blank new browser window - which looks terrible when you want the whole thing to be seamless. Obviously I can't target the same window because then the game would "disappear" - so what can I do??!

Do I have to resort to an "invisible" frameset?? Surely not!! Please tell me not!! PLEEEEAASE!

Is there no way of sending info to a database WITHOUT bringing up another browser window??

Thanks in advance

khamstra
04-02-2003, 12:05 PM
This will not open a new window, you may not be loading new variables but if you send something back you can use the onLoad function.
yourloadvars.sendAndLoad("yourpage.asp", yourloadvars, "POST");

Hope that helps,
khamstra

binkyboo
04-02-2003, 12:06 PM
gromit,

You just need to post the variables to the asp page.

sendAndLoad("processActivity.asp", variables, "POST");

You don't need to target another window to send variables.

Hope this helps!

binkyboo
04-02-2003, 12:08 PM
oops, looks like khamstra beat me and I forgot the yourVariables.sendAndLoad.

gromit
04-02-2003, 01:01 PM
Thanks for your replies. That worked a treat! THANKYOU! I didn't realise that I could use SendAndLoad simply to just Send - I always thought that you had to do both Send AND Receive.

Thanks guys that was really helpful.

just one last question before I leave you all alone... the path that I use for my asp file....does it have to be absolute? I tried doing a relative path with no joy. Its a bit of a pain really because I always use a testing server before I upload to a live server - which means when I know that its ready to go, I have to go through all of my code and make sure that I change the absolute paths that I have set up for testing. Is this "just one of those things"?? Do you know of a way of getting around it?

Cheers again

khamstra
04-02-2003, 01:13 PM
What I personally do is in my _root/main movie i insert the following code.

_global.myURL = "http://www.me.com/";

Then anywhere where I load variables or send i do this.

myvars.sendAndLoad(myURL+"my.asp", myvars, "POST");

Then you can change that to something else or leave it blank to make it relative.

As far as the absolute/relative thing goes it has to be absolute if you are testing through Flash, then it can be relative when you upload it to your server.

khamstra

gromit
04-02-2003, 01:20 PM
Thankyou yet again - I'd already done something similar to the "myurl" thing you suggested - I never realised before though that you can make a path relative once its uploaded to a server. Thanks for that - you learn something every day!