>> Can you give an example, of such a multidimensional array, and how to
do this with value objects?
Hi Cor. Sorry it took me so long to respond, due to Labor Day here in
the states.
Sure:
//Value Object examples:
package
{
public class ExampleValueObject
{
public var myProperty:String; //this
example has no default value
public var myOtherProperty:Number = 0; //this has a
default value.
public var myOtherValueObjects:Array = []; //An array to
store other value objects
}
}
package
{
public class MyOtherExampleValueObject
{
public var someOtherExampleValue:String;
}
}
//Use value objects to store data, including value objects within value
objects:
var myExampleVOs:Array = [];
for each (var exampleValue:String in someData)
{
var myExampleVO:ExampleObject = new ExampleValueObject();
myExampleVO.myProperty = exampleValue;
myExampleVO.myOtherProperty = someNumber;
for each(var someOtherValue:String in someOtherData)
{
var myOtherValueObject:MyOtherExampleValueObject = new
MyOtherExampleValueObject();
myOtherValueObject.someOtherExampleValue =
someOtherValue;
myExampleVO.myOtherValueObjects.push(myOtherValueObject);
}
myExampleVOs.push(myExampleVO);
}
Now you have an array of ExampleValueObjects, and each of those have
properties - and one of those properties is an array of
MyOtherExampleValueObjects. And your code completion (at least in a
good AS code editor) will work on all this data, so no mistakes or
guesswork, and you've described related data in a logical, easy to
access, typecast and easy-to-transfer-around way.
Jason Merrill
Instructional Technology Architect
Bank of America Global Learning
Join the Bank of America Flash Platform Community and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders