Thinking in Flex

本文介绍Flex开发的基本概念,包括页面背景色、大小设置等属性的调整方法,并演示了UI组件排版及数据绑定的实现方式。

Flex开发对于一个熟悉ActionScriptXML语法的人来说比我想象中的要简单,效果也非常显著。也不要把Flex想象的非常神秘,查看生成的页面可以看到Flex不过通过服务器端的转换把xml文件编译成一个SWF文件显示在网页中(而且还不是显示在屏幕中间)。如果熟悉样式表的使用的话,mxml的属性也很容易理解和掌握。
举几个例子,Flex页面背景色是默认的,想要更换的话,可以在mx:Application标记中添加

1. backgroundColor='#ffffff' 


也可以定义页面SWF文件的大小

1. width='450' height='250'


我们要定义某个UI组件的margin属性可以用

1. marginTop='10' marginBottom='10'  marginLeft='10' marginRight='10'


更改文本输入框的颜色和字体大小可以用

1. color='#6601D7' fontSize='24'


是否觉得和内嵌式样式表的书写方式非常接近呢?
Flex
对样式表的支持弥补了Flash本身的缺陷,使得Flex作为网页应用的可能性变的可能。
另外一个好用的功能是通过数据绑定操作可以实现以前需要使用复杂的JS脚本才能完成的功能,的确值得赞扬。
下面的例子实现了list组件和textinput组件之间的数据绑定

1. <mx:List id='myList' dataProvider=''/>

2. <mx:TextInput  text=''/>


界面的排版工作Flex又是如何完成的呢?
聪明的MM使用了<mx:HBox> <mx:VBox>
Flex
调用自定义组件的方式也非常简单,如同导入一个库文件一样,使用方式为:

1. <local:组件MXML文件名称/>

并且支持自己的命名空间

1. xmlns:my='containers.boxes.*' 

 

The navigation bar has been streamlined and reconfigured: Adhering to the concept of simplicity and intuitiveness, the navigation bar has been restructured with vivid ICONS and concise text to enhance key entry points such as menus, offers, and ordering. At the same time, an intelligent search function has been embedded to help users reach their desired content with just one click. In-depth rectification of information architecture: Based on users' thinking and browsing preferences, comprehensively sort out the information context of the website, and refine an information architecture with distinct layers and clear logic, enabling users to quickly capture key information following their intuition. Personalized recommendation engine injection: Deeply explore the"gold mine"of user behavior data, build a personalized recommendation system, and enable users to encounter dish recommendations that match their tastes and tailor-made discount surprises every time they visit.您的目标是通过解决主页、下单流程和网站导航方面的问题来改善买家体验。作为前端开发人员,您的职责将集中在网站面向用户的方面。您将使用 JavaScript、HTML 和 CSS 实现交互式设计。如有必要,您可以优化评估 1 中的建议设计,以确保它满足用户要求并提供最佳体验。与项目评估策略的关系 该评估的重点是实施和演示拟议的前端改进,通过应用理论概念和实际的 Web 开发技能,直接为模块的目标做出贡献。
06-23
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值