如何调用动态单选按钮中的功能?
我使用 XML 创建了一个测验应用程序。
我的 XML 代码:
<item>
<question type="singleChoice">
<![CDATA[1.What does CSS stand for?]]>
</question>
<answer correct="yes">Cascading Style Sheets</answer>
<answer>Computer Style Sheets</answer>
<answer>Colorful Style Sheets</answer>
<answer>Creative Style Sheets</answer>
</item>
和我的 Flex 脚本代码:
protected function buildQuestion():void {
var question:XML=XML(xmlList[quizIndex])
answerOption.removeAllElements()
if(question.question.@type == SINGLE_CHOICE)
{
for each(var tempxml:XML in question.answer)
{
var rad:RadioButton= new RadioButton();
rad.label=tempxml[0];
answerOption.addElement(rad);
}
}
如何访问当前单选按钮来验证此答案?
I have created a quiz app using XML.
My XML code:
<item>
<question type="singleChoice">
<![CDATA[1.What does CSS stand for?]]>
</question>
<answer correct="yes">Cascading Style Sheets</answer>
<answer>Computer Style Sheets</answer>
<answer>Colorful Style Sheets</answer>
<answer>Creative Style Sheets</answer>
</item>
and my flex Script code:
protected function buildQuestion():void {
var question:XML=XML(xmlList[quizIndex])
answerOption.removeAllElements()
if(question.question.@type == SINGLE_CHOICE)
{
for each(var tempxml:XML in question.answer)
{
var rad:RadioButton= new RadioButton();
rad.label=tempxml[0];
answerOption.addElement(rad);
}
}
How can I access the current radio button to validate this answer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
spark.components.RadioButtonGroup
为此:You can use
spark.components.RadioButtonGroup
for that: