
Welcome Guest
|
#1
|
|||
|
|||
|
LoadVars() and global variable problems
Hello,
I have an ongoing problem w/ the LoadVars() function and the scope of variables. I would loke to have a situation where I can read the values of a file, set those read values to global variables and use them throughout the program. Now know I can set a text box to recieve the read values but It seems like a copout Here's the code I'm using: I know there's probably an easy solution staring me in the face. Actionscript:
_global.db_script_data = new LoadVars();
db_script_data.onLoad = function(success)
{
if( success == true )
{
_global.user_level = db_script_data.user_level;
_global.user_id = db_script_data.user_id;
}
else
{
txt_output += "\n !!!!No read vars failed!";
}
trace( "user_id: " + user_id ); //will show user_id as "1"
}
db_script_data.sendAndLoad( "verify.php", db_script_data, "POST");
trace( "user_id: " + user_id ); //will show user_id as undefinedClem |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| onLoad-function question (need it to set a value to an variable outisde the function) | nurgle | Actionscript 2.0 |
1 | 08-23-2005 07:01 PM |
| LoadVars() not populating dynamic text field... | nrutman | Flash MX ActionScript |
1 | 02-25-2005 03:32 PM |





