Tut33: 會員登記表單: 範例

 

這個單元將使用組件來讓使用者輸入會員資料,並將資料彙整後,在輸出給使用者看。

 

使用到的UI組件包含button, ComboBox, RadioButton, TextArea, TextInput

 

製作步驟如下:

1.      放入底圖。

2.      [視窗/組件]打開組件,將所需要的組件放入場景。

3.      加入文字。

4.      製作送出表單的介面

5.      加入action scrip

 

stop();

 

function checkValue() {

        get_result = "姓名:" + _root.user_name.text;

        get_result = get_result + "\n性別:" + _root.sex.selectedData;

        get_result = get_result + "\n電話:" + _root.user_tel.text;

        get_result = get_result + "\n興趣:" + _root.interest.selectedItem.label;

        get_result = get_result + "\n意見:" + _root.notes.text;

        show_value=get_result;

        gotoAndStop("ok");

}

 

_root.btn.addEventListener("click", checkValue);

// 其中最後ㄧ行是利用呼叫按鈕的click事件去執行checkValue函數。

 

6.      在文字的最後依個影格加標籤ok