1
我試圖做很多方法,但對於我的生活無法想象如何。基本上我有一個列表。選擇列表中的項目時,單選按鈕標籤會發生變化。但是,我希望一個標籤和文本區域出現,一旦用戶點擊了單選按鈕(如果它是正確的)。 到目前爲止的代碼: - 從列表組件到單選按鈕的Adobe flex
<s:VGroup x="103" y="130" width="123" height="125">
<s:RadioButton id="RadioButton1" label="{data.QuestionsRadioButton1}" groupName="QuestionsTestRadioButtons" click="RadioButton1_clickHandler(event)"/>
<s:RadioButton label="{data.QuestionsRadioButton2}" groupName="QuestionsTestRadioButtons" click="radiobutton1_clickHandler(event)" />
<s:RadioButton id="RadioButton3" label="{data.QuestionsRadioButton3}" groupName="QuestionsTestRadioButtons" click="radiobutton2_clickHandler(event)"/>
</s:VGroup>
我不會發布的所有代碼,我們將永遠在這裏。然而,有沒有辦法可能是一個if函數?說出單擊的單選按鈕實際上是否是正確的答案?
任何建議將是有益的 謝謝
不知道你的數據結構;或者如何顯示單選按鈕我們怎麼樣 - 當堆棧溢出問題的答案 - 應該知道是否點擊了正確的項目?然後將其擴展到Flex;框架應該如何知道?除非你告訴它,否則它不會。如果你有動態的問題/答案;您需要以某種方式加載正確的答案,然後他們與選定的答案進行比較。想必你會在單選按鈕上設置一個「值」,你可以用它來比較「正確」的答案。 – JeffryHouser