owl527
11-14-2003, 04:43 AM
Hi,
i have an external file that contains a multidimensional array. it looks something like this:
var map = [
[2,2,5,2,1,2,2],
[2,0,2,2,3,2,2],
[2,2,2,2,2,0,0]
]
I try to load the file into flash by writing:
Externaldata= new LoadVars();
Externaldata.load("solarintensity.as");
Externaldata.onLoad= function(success){
if (success){
trace(Externaldata);
SolarArray= new Array();
SolarArray = Externaldata;
trace ("first number: " + SolarArray.map[1][1]);
this is what I get:var%20map%20=%20%5B%0D%0A%5B2%2C2%2C2 .....
and for the second trace Igot:first number : undefined
how exactly can I read the file in as an array and be able to use it the way it is in flash? or how do I access the data?
Hope someone can help me!!! THANKS SO MUCH!!!!
Please use the proper code syntax to format the code.
Read this page (http://www.actionscript.org/forums/misc.php3?action=bbcode#buttons) to find out more about the tag information
i have an external file that contains a multidimensional array. it looks something like this:
var map = [
[2,2,5,2,1,2,2],
[2,0,2,2,3,2,2],
[2,2,2,2,2,0,0]
]
I try to load the file into flash by writing:
Externaldata= new LoadVars();
Externaldata.load("solarintensity.as");
Externaldata.onLoad= function(success){
if (success){
trace(Externaldata);
SolarArray= new Array();
SolarArray = Externaldata;
trace ("first number: " + SolarArray.map[1][1]);
this is what I get:var%20map%20=%20%5B%0D%0A%5B2%2C2%2C2 .....
and for the second trace Igot:first number : undefined
how exactly can I read the file in as an array and be able to use it the way it is in flash? or how do I access the data?
Hope someone can help me!!! THANKS SO MUCH!!!!
Please use the proper code syntax to format the code.
Read this page (http://www.actionscript.org/forums/misc.php3?action=bbcode#buttons) to find out more about the tag information