2012-01-10 79 views
0

我正在爲手機制作一個測驗應用程序。問題來自xml。 我如何製作多行Radibuttons?我試圖做一個皮膚類,但它沒有奏效。 在這段代碼中,我製作了RadioButtons。Flash Builder 4.6中的動態Radiobutton - 如何使它成爲多行?

enterfor (j=0; j<arrAnswers[index].length; j++) { 
      arrChoices[j] = new RadioButton() 

      arrChoices[j].label = arrAnswers[index][j]; 
      arrChoices[j].value = j; 
      arrChoices[j].width = qField.width; 
      arrChoices[j].x = qField.x + 10; 
      arrChoices[j].y = qField.y + qHeight + (aHeight+5)*j; 
      arrChoices[j].group = rbg 

      container.addElement(arrChoices[j]); 

     } code here 

回答

0

請參考以下鏈接:
http://blog.flexexamples.com/2010/04/10/creating-a-multiline-spark-radiobutton-control-in-flex-4/
http://blogs.adobe.com/aharui/2007/04/multiline_buttons.html
blogs.adobe.com下載的代碼,並使用自定義單選按鈕

var radiobtn:MultilineRadioButton=new MultilineRadioButton(); 
+0

謝謝M.SNayak!我也發現,但4.6計數讓它起作用。也許我做錯了什麼。在第一個例子中,它使用mxml生成Radiobutton。我如何參考actionscript中的樣式? – 2012-01-10 12:58:22

+0

在其他情況下,我使用'mycomponent.setStyle'屬性,但在這種情況下,我對此沒有太多的想法:(。 – 2012-01-10 13:03:06

+0

我也試過Flex 4教程,並在開始時收到警告 - 說明\t資源\t \t路徑位置\t類型 CSS類型選擇未在組件支持: 'spark.components.RadioButton' \t \t RadioparaHomeView.mxml/Radiopara/SRC /視圖\t線12 \t Flex的問題 – 2012-01-10 13:13:32