Model 数据模型和绑定
1:写在页面中
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<fx:Model id="groceryInventory1">
<groceries>
<catName>Dairy</catName>
<prodName>Milk</prodName>
<imageName>assets/dairy_milk.jpg</imageName>
<cost>1.20</cost>
<listPrice>1.99</listPrice>
<isOrganic>true</isOrganic>
<isLowFat>true</isLowFat>
<description>Direct from California where cows are happiest!</description>
</groceries>
</fx:Model>
</fx:Declarations>
2:写在外部文件
<fx:Model id="groceryInventory" source="assets/inventory.xml"></fx:Model>
使用时候,在具体空间中 text 使用 {groceryInventory.description}
flex 的函数体
1:不带参数 2 带参数
2:鼠标事件
评论0