LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-10-2004, 10:17 PM
clem_c_rock clem_c_rock is offline
Registered User
 
Join Date: Jul 2004
Posts: 60
Rep Power: 9
clem_c_rock is on a distinguished road
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 undefined
Thanks,
Clem
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 11:45 AM.