Apache flex 访问标签时出现问题';手风琴中的s值';s选定的子对象
我的申请表上有一个手风琴手。手风琴的每个孩子都有一个标签(firstNameLabel)和一个按钮(addPolicyButton)。标签的值通过中继器和数组进行设置 单击AddPolicy按钮时,如何访问firstNameLabel的“选定的手风琴子对象”值 在以下代码中,testTextArea.appendText在testTextArea中打印“fname:undefined”。 正如我在手风琴中看到的,集合标签的文本被设置为“Michael”,这就是repMonitor.currentItem.firstName返回的内容 代码:Apache flex 访问标签时出现问题';手风琴中的s值';s选定的子对象,apache-flex,flex4,flash-builder,Apache Flex,Flex4,Flash Builder,我的申请表上有一个手风琴手。手风琴的每个孩子都有一个标签(firstNameLabel)和一个按钮(addPolicyButton)。标签的值通过中继器和数组进行设置 单击AddPolicy按钮时,如何访问firstNameLabel的“选定的手风琴子对象”值 在以下代码中,testTextArea.appendText在testTextArea中打印“fname:undefined”。 正如我在手风琴中看到的,集合标签的文本被设置为“Michael”,这就是repMonitor.current
private函数addPolicy():void{
testTextArea.appendText(“fname:+firstnamelab.text”);
}
以下操作非常有效。;)
testTextArea.appendText(“fname:+monitoringArray.getItemAt(monAccordian.selectedIndex).firstName+”\n”)
private function addPolicy():void{
testTextArea.appendText("fname:"+firstNameLabel.text);
}
<mx:Accordion id="monAccordian" includeIn="Monitoring" x="10" y="10" width="554" height="242" change="monAccordianChange()" >
<mx:Repeater id="repMonitor" dataProvider="{monitoringArray}">
<mx:Canvas width="100%" height="100%" label="{repMonitor.currentItem.firstName}" >
<s:Label id="firstNameLabel" text="{repMonitor.currentItem.firstName}"/>
<mx:Button x="450" y="8" id="addPolicyButton" label="Modify policy" click="addPolicy();" visible="true"/>
</mx:Canvas>
</mx:Repeater>
</mx:Accordion>
<s:TextArea x="138" y="30" enabled="true" id="testTextArea" x.MainPage="80" y.MainPage="100" visible="true"/>