<? xml version="1.0" encoding="utf-8" ?> < mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml" layout ="absolute" > < mx:Panel x ="10" y ="10" width ="480" height ="355" layout ="absolute" title ="查看信息" > < mx:Image x ="28" y ="10" height ="131" width ="88" id ="pic" /> < mx:Label x ="162" y ="20" id ="lblName" /> < mx:LinkButton x ="162" y ="46" id ="lbtnBlog" /> < mx:LinkButton x ="162" y ="76" id ="lbtnRss" /> </ mx:Panel > <!-- 使用Model对象定义数据,可以直接用于绑定,注意:必须是XML树型结构 --> < mx:Model id ="users" > < users > < user > < name > Peter </ name > < blog > http://www.163.com </ blog > < rss > http://www.wangjun.com </ rss > < pic > img/5.jpg </ pic > </ user > </ users > </ mx:Model > <!-- 定义绑定 --> < mx:Binding source ="users.user.name" destination ="lblName.text" ></ mx:Binding > < mx:Binding source ="users.user.blog" destination ="lbtnBlog.label" ></ mx:Binding > < mx:Binding source ="users.user.rss" destination ="lbtnRss.label" ></ mx:Binding > < mx:Binding source ="users.user.pic" destination ="pic.source" ></ mx:Binding > <!-- source代表数据,destination代表目标对象的属性 --> </ mx:Application >