stop(); import AppForm; System.useCodepage = false; var sendLV:LoadVars = new LoadVars(); var resultLV:LoadVars = new LoadVars(); //php程式名稱 var contactScript:String = "form.php"; //php表單送值方式 var method:String = "POST"; var myAppForm = new AppForm(); var thisMC:MovieClip = this; cb_sex.addItem({label:'請選擇',data:'null'}); cb_sex.addItem({label:'男',data:'男'}); cb_sex.addItem({label:'女',data:'女'}); var zip:Zip = new Zip(city_cb,county_cb,zip_txt); myAppForm.setMsg(DisplayMsg); /* myAppForm.addFormItem("程式欄位名稱",flash元件名稱,"text",是否必填(true|false),"提示文字"); */ myAppForm.addFormItem("name",name_txt,"text",true,"姓名"); myAppForm.addFormItem("gentle",cb_sex,"cb",true,"性別"); myAppForm.addFormItem("bday_year",year_txt,"text",true,"生日-年"); myAppForm.addFormItem("home_tel",tel_txt,"text",true,"電話"); myAppForm.addFormItem("zip",zip_txt,"text",true,"縣市"); myAppForm.addFormItem("home_addr",addr_txt,"text",true,"地址"); myAppForm.addFormItem("email",email_txt,"email",true,"Email"); myAppForm.initForm(); function DisplayMsg(a_str:String) { msg_txt.text = a_str; } function DestroyMsg() { msg_txt.text = ''; } resultLV.onLoad = function() { trace('result'); }; submit_btn.onRelease = function() { sendLV = myAppForm.submit(); /* if(cb_sex.value=='請選擇') { DisplayMsg('請選擇性別'); return; } if(city_cb.value=='請選擇縣市') { DisplayMsg('請選擇縣市'); return; } if(county_cb.value=='請選擇鄉鎮') { DisplayMsg('請選擇鄉鎮'); return; } */ //City if (sendLV != undefined) { sendLV.gentle = cb_sex.value; sendLV.City = city_cb.value; sendLV.Canton = county_cb.value; sendLV.APPL_ZIP = zip_txt.text; // _parent.thankyou_mc._visible = true; thisMC._visible = false; DestroyMsg(); //測試的話用這一行。 //sendLV.send(contactScript,method); sendLV.MM_insert = 'appl'; for (var i in sendLV) { trace(i+" "+sendLV[i]); } sendLV.sendAndLoad(contactScript,resultLV,method); } };