flex中后台怎样接收页面上传来的参数?

就那一个添加用户信息的例子来说吧... 就那一个添加用户信息的例子来说吧 展开
 我来答
匿名用户
2013-06-09
展开全部
先写一个addmemberVO.aspackage vo
{
[Bindable]
public class memberVO
{
public var id:int;

public var firstname:String;
public var surname:String;
public var birth:String;
public var gender:String;
public var address:String;
//
public var email:String;
public var password:String;
public var mobilenumber:String;
public var profession:String;
public var employer:String;
public var nominatedby:String;

public var describe:String;
public var perfect:String;
public var favourite:String;
public var photo:String;
public var seq:String;

public var addtime:String;

public var status:String;

public var que4:String;

//使用数据填充对象
public function fill(obj:Object):void{

for(var i:* in obj){
this[i] = obj[i];
}
}
}
} 2.然后在addmember.mxml上写: 这个是添加的方法:public function addButtonMember():void
{

var addMemberData:memberVO=new memberVO();
if(nopic.source!="icons/nopic.png"){
addMemberData.firstname=firstname.text;
addMemberData.surname=surname.text;
addMemberData.birth=birth.text;
addMemberData.gender=radioGroup.selectedValue.toString();
addMemberData.address=address.text;

addMemberData.email=email.text;
addMemberData.password=password.text;
addMemberData.mobilenumber=mobilenumber.text;
addMemberData.profession=profession.text;
addMemberData.employer=employer.text;
addMemberData.nominatedby=nominatedby.text;

addMemberData.status=status.selectedItem.label;

addMemberData.describe=describe.text;
addMemberData.perfect=perfect.text;
addMemberData.favourite=favourite.text;
addMemberData.photo=this.photoSrc;

addMemberData.que4=que4.text;

dbConn.addMemberInfo(addMemberData);

}else if(nopic.source=="icons/nopic.png"){
Alert.show("please write photoSrc!");
}

} 页面的布局:<mx:Array id="arr">
<mx:Object label="Male" data="Male" />
<mx:Object label="Female" data="Female" />

</mx:Array> <mx:Button x="71" y="554" buttonMode="true" useHandCursor="true" styleName="themeButton" icon="@Embed(source='/icons/new_item2.png')" toolTip="New item" click="addButtonMember()" />
<mx:Label x="89" y="33" text="FIRST NAME:"/>
<mx:Label x="102" y="62" text="SURNAME:"/>
<mx:Label x="74" y="88" text="DATE OF BIRTH:"/>
<mx:TextInput x="198" y="32" height="18" width="293" id="firstname"/>
<mx:TextInput x="198" y="58" height="18" width="293" id="surname"/>
<mx:TextInput x="198" y="84" height="18" width="293" id="birth"/>
<mx:HBox id="hb" x="198" y="110" >
<mx:RadioButtonGroup id="radioGroup" />
<mx:Repeater id="radioRepeater"
dataProvider="{arr}">
<mx:RadioButton id="radioButtons"
label="{radioRepeater.currentItem.label}"
selected="true"
group="{radioGroup}"
/>
</mx:Repeater>
</mx:HBox>
<mx:TextInput x="198" y="136" height="18" width="293" id="address"/>
<mx:TextInput x="198" y="170" height="18" width="293" id="email"/>
<mx:TextInput x="198" y="197" height="18" width="293" id="password"/>
<mx:TextInput x="198" y="224" height="18" width="293" id="mobilenumber"/>
<mx:TextInput x="198" y="254" height="18" width="293" id="profession"/>
<mx:TextInput x="198" y="280" height="18" width="293" id="employer"/>
<mx:TextInput x="198" y="306" height="18" width="293" id="nominatedby"/>
<mx:ComboBox id="status" x="198" y="332" dataProvider="{ModelLocator.statusArr}"></mx:ComboBox>
<mx:Label x="111" y="111" text="GENDER:"/>
<mx:Label x="107" y="137" text="ADDRESS:"/>
<mx:Label x="121" y="171" text="EMAIL:"/>
<mx:Label x="95" y="198" text="PASSWORD:"/>
<mx:Label x="63" y="225" text="MOBILE NUMBER:"/>
<mx:Label x="87" y="255" text="PROFESSION:"/>
<mx:Label x="95" y="281" text="EMPLOYER:"/>
<mx:Label x="71" y="308" text="NOMINATED BY:"/>
<mx:Label x="71" y="354" text="How would your friends describe you?" width="284"/>

<mx:TextInput x="71" y="372" width="749" height="26" id="describe"/>
<mx:TextInput x="71" y="421" width="749" height="26" id="perfect"/>
<mx:TextInput x="71" y="469" width="749" height="26" id="favourite"/>
<mx:TextInput x="71" y="520" width="749" height="26" id="que4"/>
<mx:Label x="71" y="402" text="Brlefly tell us about your perfect night out." width="284"/>
<mx:Label x="71" y="449" text="What is your favourite club in London and why?" width="284"/>
<mx:Label x="71" y="503" text="Where did you heard about us?" width="284"/>
<mx:Button x="774" y="554" buttonMode="true" useHandCursor="true" styleName="themeButton" toolTip="Close" icon="@Embed(source='/icons/close2.png')" click="closeWindow()"/>
<mx:Image id="nopic" x="566" y="32" width="122" height="81" toolTip="Click to upload" click="upload()" source="icons/nopic.png"/>
<mx:ProgressBar id="bar" labelPlacement="center" themeColor="#F20D7A"
minimum="0" visible="true" maximum="100" label="Please select a file"
direction="right" mode="manual" width="122" y="34" x="566" height="81" />

<mx:Label x="123" y="334" text="Status:"/> 这样后台就可以一次性的接收到页面传来的参数!
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式