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




 
 
Thread Tools Display Modes
  #1  
Old 06-18-2005, 04:49 PM
dany dany is offline
Registered User
 
Join Date: Jun 2005
Posts: 2
Rep Power: 0
dany is on a distinguished road
Question LoadVars giving problems. can't access the variables

hello,
I am trying to load variables from a text file using loadVars. now, I can SEE that whatever I have is loaded, BUT can't access it... the thing is I wanna be able to access it dynamically. example:
I have in the text file:

&display1=true
&display2=false
&display3=true

now if I trace(this.display1) I get 'true'. BUT, I wanna be able to access it dynamically using it's number, which is 1. if I do this:
i=1;
theName="display" +i;
trace(this.theName);

I get unidefined for the value, I kind of understand why it happens, I just need to know how I can access the values I need using a similar method.
Please help and thank you for replying!!
Dany
  #2  
Old 06-19-2005, 11:40 PM
Scottae's Avatar
Scottae Scottae is offline
God Moderator
 
Join Date: Oct 2003
Location: United States
Posts: 6,532
Rep Power: 16
Scottae is on a distinguished road
Try this:

Actionscript:
this[theName]
__________________
Our greatest glory is not in never falling but in rising everytime we fall. - Confucius

Blog | Shared Items
  #3  
Old 06-20-2005, 10:20 AM
dany dany is offline
Registered User
 
Join Date: Jun 2005
Posts: 2
Rep Power: 0
dany is on a distinguished road
Thumbs Up It works!!

Thank you ever so much Scottae!!
I knew this is also an array, didn't know exactly where to use it....
thanks again...
This is great as this is my first post!
glad to be apart of this community
 


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
Problems: movie clip variables within class and error 1120. iblokh Flash CS3 / Flash 9 1 10-17-2007 05:55 PM
LoadVars() and global variable problems clem_c_rock Flash MX 2004 1 12-03-2004 03:38 PM
Setting search variables using the LoadVars object PUP100 Flash MX ActionScript 4 05-02-2004 01:53 PM
problems with .load using variables longanimous Newbies 2 04-27-2004 05:39 PM
access variables across movies schlumpf Flash MX ActionScript 1 09-05-2002 08:27 AM




All times are GMT. The time now is 03:49 PM.