When you assign dynamic or more complex values, and especially if you don't
want this array to be shared (by reference) to all instances of the class,
it's best to initialize in the constructor.
There aren't any limitations on multidim. arrays in objects, classes, or
objects in classes and so on. I suspect the particular syntax you used was
not correct, hence your issues. It'd help to post this instead.
Regards, Stan Vassilev
----- Original Message -----
From: "Gareth Hudson" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, January 20, 2007 2:02 PM
Subject: [Flashcoders] Multi-dimensional array problems in classes
Hi there,
Does anyone know if it we are supposed to use multi-dimensional arrays
(an array consisting of arrays) within a class? If so, what is the
best, legal way to create them?
The only way I have managed to do it is by this method:
var reactionStoichiometry:Array = new Array (
new Array (1, 3, 2, 0),
new Array (1, 2, 1, 0),
new Array (2, 1, 2, 0),
new Array (2, 0, 1, 3),
new Array (2, 0, 2, 1),
new Array (1, 0, 1, 1),
new Array (1, 1, 2, 0),
new Array (1, 1, 2, 0),
new Array (1, 1, 1, 1));
Any other ways of creating them give me a compile error saying that they
are not allowed within a class. I need to assign these values
dynamically, the above ones a for testing, and would prefer to do it by
addressing the locations in the main array by position number for
inserting the other arrays within it. Classes don't seem to like
Objects containing arrays either.
Many thanks,
Gareth Hudson.
_______________________________________________
[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
_______________________________________________
[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