HOME       >>       Programming

Actionscript : Using Loadvars() Online. I need help with using LoadVars(); online.


ewcreators

http://forums.xisto.com/no_longer_exists/:
myVariable=How are you today?&money=10000

Actionscript:
var myData:LoadVars=new LoadVars();myData.onLoad = function () { thelist.addItem(this.money);}myData.load("http://revolutions.ifastnet.com/misc/myText1.txt");

Now in my list component on my flash stage, when i run the .swf, where the money variable 10000 should be, it just says undefined,undefined.

When i run the .swf from my local home directory, it says undefined and doesn't display the variable.
Even when i upload it, it doesnt display the variable.
Please help , since i want to display php details of my users of my website in a flash app which i will only do once i test my flash connections.

galexcd

Well I've never liked LoadVars too much. I much prefer the loadVariablesNum() function mainly because you don't have to use objects for it, but are you loading this data on the same level as where you are retrieving it? Meaning are you doing this on the root level and you are attempting to get the data in a movieclip? If thats not the case then I'd suggest using loadVariablesNum. Every time I have tried to use LoadVars it gives me tons of problems and loadVariablesNum just works instantly.


ewcreators

ok nvm that, im usingxml.But how do i send data back to the server?like send("url",variable,method),i dont exactly know how to use this syntax.


galexcd

The loadVariablesNum method can do that too. And you can even specify if you want to send the variables to the server over post or get. I believe when you have the last parameter it automatically sends the server every variable that you have saved on that level.

Example:

loadVariablesNum ("file.xml", 0, "POST");


ewcreators

but shouldn't it actually be ("file.xml",variable=0,"GET"); for get? otherwise, how can we give it a name when using method post?Also, how do we send strings then using loadVariablesNum


galexcd

but shouldn't it actually be ("file.xml",variable=0,"GET"); for get? otherwise, how can we give it a name when using method post?Also, how do we send strings then using loadVariablesNum



Well yes, if you put "GET" in the parameter it will send the variables using get rather than post. It just depends on what type of variable your php page is looking for. And you can send strings the same way you send any other variable. Just set them to a string rather than a different variable. And, I don't know why you added variable=0 to the second parameter. It should just be 0. You can put a level in there if your code is executing on a different level.


VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.