Espero que pronto empiece a escribir un tutorial que recoja esa duda...
Lo ideal sería tener un VO (Value Object, puedes mirar sobre ellos en
madeinflex) que sea propiedad del contenedor que en el quieras mostrar los datos. El VO tendrá a su vez una propiedad que será un array con las preguntas, y haces que por cada pregunta cargue una vez un componente .mxml que contendrá las posibles opciones, sería algo como esto:
Código :
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel initialize="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="580" height="146" xmlns:view="clases.view.*">
<mx:Script>
<![CDATA[
//import mx.states.AddChild;
import mx.controls.CheckBox;
import clases.vos.QuestionVO;
import clases.vos.SubjectVO;
[Bindable]
public var subject:SubjectVO;
public function init():void{
this.title=subject.name;
for each (var item:QuestionVO in subject.questions){
var preg:Pregunta=new Pregunta();
preg.question=item;
vB.addChild(preg);
this.height+=preg.height;
}
}
]]>
</mx:Script>
<mx:HBox x="0" y="10" width="100%" id="hB" horizontalAlign="right">
</mx:HBox>
<mx:VBox id="vB" enabled="{subject.selected}" x="0" y="38" width="100%" height="100%" horizontalAlign="center">
</mx:VBox>
</mx:Panel>