This is how I like to organize that type of thing - I would do an array
of objects - then just set properties on those objects, some of which
can be arrays if you want - or anything else. Like this:
var numObjects:Number = 15;
var Config:Array = new Array();
for(var i=0; i<numObjects; i++){
Config[i] = new Object();
Config[i].typeA = new Array("A");
Config[i].typeB = new Array("A", "B");
Config[i].typeC = new Array("A", "B", "C");
};
Then to access the configuration for type C:
var myConfigArray:Array = Config[3].typeC//returns an array of "A", "B",
"C"
var myConfig:Array = Config[3].typeC[2]//returns "C"
var numValues:Number = Config[3].typeC.length; //returns 3
Jason Merrill | E-Learning Solutions | icfconsulting.com
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of eric dolecki
>>Sent: Tuesday, March 28, 2006 2:44 PM
>>To: Flashcoders mailing list
>>Subject: [Flashcoders] Architecture opinion...
>>
>>I'm about to create an uber-class that is basically something that
controls
>>walkthroughs of various situations.
>>
>>I have configuration states... (sets of three basically)
>>
>>var CONFIG_1A :Number = 0; // Has item A
>>var CONFIG_1B:Number = 1; // Has item A and B
>>var CONFIG_1C:Number = 2; // Has item A and B and C
>>var CONFIG_2A:Number = 3; // Has item A and D
>>var CONFIG_2B:Number = 4; // has item A and D and B
>>... etc. for quite a number of different configuration options. 15 of
them
>>in total.
>>
>>
>>I am using CONFIG_ for use in if/else statements, etc. but I don't
think
>>this is a very elegant way of doing things. I'd like the code to be
readable
>>& this isn't much better than using simple numerals to set this up. I
am
>>looking for opinions on how to best set this up. Something where if I
wanted
>>to later could add CONFIG_1D and wouldn't have to renumber things. An
array
>>of configs?
>>
>>Each config setting will have different paths throughout a "tutorial".
What
>>might be the best way to avoid having switches or if/else statements
galore
>>at each step of the process?
>>
>>Thanks - I know this is a strange request :)
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
NOTICE:
This message is for the designated recipient only and may contain privileged or
confidential information. If you have received it in error, please notify the
sender immediately and delete the original. Any other use of this e-mail by you
is prohibited.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com