Hi Mike,
Thanks for your reply. I understand that components are compiled to AS
classes, which I why I originally tried code much like yours. Here's mine:
//import the component
import views.SingleConfig;
//function to build the children
private function buildConfigs():void{
var singleConfig:SingleConfig;
//configDisplay is the parent visual component - configArray holds the
configuration objects.
configDisplay.removeAllChildren();
for (var i:int=0;i < configArray.length;i++){
singleConfig:SingleConfig = new SingleConfig();
//configInfo is a public var in the custom component to hold the
configuation object to be displayed.
singleConfig.configInfo = configArray[i];
configDisplay.addChild(singleConfig);
}
}
The above generates multiple errors. The first is "Implicit coercion of of
value of type views:SingleConfig to an unrelated type Class." The comes on
the line with the "new SingleConfig()" statement.
Then, when the child is created, an error of "Illegal assignment to class
SingleConfig" occurs.
Can you help me understand what I'm doing wrong?
--
Thanks,
Tom
Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560