Jump to content
xisto Community
Sign in to follow this  
ewcreators

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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");

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.