IF语句&Flash传值ASP.NET(as2.0)
- 选择语句,
-
- 一、要注意把左边的条件语句不是"="而是"=="
-
- 二、IF语句没有then 用{}代替
-
- 三、把数据从Flash传到ASP.NET 使用SendData语句
- on (release) {
-
- if (fname.text=="") {
-
- st.text="Please enter names!";} else if (lname.text=="") {
-
- st.text="Please enter names!";} else if (co.text=="") {
-
- st.text="Please enter Company/Organization!";} else if (tm.text=="") {
-
- st.text="Please enter Telephone/Mobile!";} else if (address.text=="") {
-
- st.text="Please enter Address!";} else if (fax.text=="") {
-
- st.text="Please enter Fax!";} else if (email.text=="") {
-
- st.text="Please enter email!";} else if (msg.text=="") {
-
- st.text="Please enter message!";} else if (scs.text=="") {
-
- st.text="Please enter Sample card-swatch you would like to receive!";} else {
-
- var sendData = new LoadVars();
-
- sendData.fname = this.fname.text;
-
- sendData.lname = this.lname.text;
-
- sendData.co = this.co.text;
-
- sendData.tm = this.tm.text;
-
- sendData.address = this.address.text;
-
- sendData.fax = this.fax.text;
-
- sendData.email = this.email.text;
-
- sendData.msg = this.msg.text;
-
- sendData.scs = this.scs.text;
-
- sendData.sendAndLoad("mail.aspx",sendData,"post");
-
- st.text="Mial is send !"
-
- fname.text="";
-
- lname.text="";
-
- co.text="";
-
- tm.text="";
-
- address.text="";
-
- fax.text="";
-
- email.text="";
-
- msg.text="";
-
- scs.text="";
-
- gotoAndStop(96);}
-
- }