You can write an MXML application in a single file or in multiple files. You typically define a main file that contains the <mx:Application> tag. From within your main file, you can then reference additional files written in MXML, ActionScript, or a combination of the two languages.
A common coding practice is to divide your Flex application into functional units, or modules, where each module performs a discrete task. In Flex, you can divide your application into separate MXML files and ActionScript files, where each file corresponds to a different module. By dividing your application into modules, you
provide many benefits, including the following:
Ease of development Different developers or development groups can develop and debug modules independently of each other.
Reusability You can reuse modules in different applications so that you do not have to duplicate your work.
Maintainability You can isolate and debug errors faster than if your application is developed in a single file.
In Flex, a module corresponds to a custom component implemented either in MXML or in ActionScript. These custom components can reference other custom components. There is no restriction on the level of nesting of component references in Flex. You define your components as required by your application.
您可以将一个MXML应用程序写在一个或多个文件中。通常定义一个包含<mx:Application>标签的主文件。然后您可以从您的主文件中,引入其他MXML文件,ActionScript,或者是两种语言的结合。
一个通常的编程方法,是将Flex程序按照功能划分为单元或模块,每个模块执行一个单独的任务。在Flex中,您可以将您的应用程序分成独立的MXML文件和ActionScript文件,每个文件对应到不同的模块。将功能分成模块会为您的应用程序提供许多好处,包括以下内容:
易于开发 不同的开发人员或开发小组可以独立于彼此来进行模块的开发和调试。
可重用性 您可以在不同的应用程序中使用您的模块,使您不必做重复性的工作。
可维护性 相比于您将应用程序写在一个文件中,分成模块的方式可以更快的将错误分离出来并加以调试
Flex中,可以在MXML或ActionScript中实现对应一个模块的自定义组件。这些自定义组件可以引用其他自定义组件。目前,关于Flex组件的引用和嵌套级别并没有限制。您可根据您的应用程序的需求来定义您的组件。
分享到:
相关推荐
微信小程序——FlexLayout布局(截图+源码).zip 微信小程序——FlexLayout布局(截图+源码).zip 微信小程序——FlexLayout布局(截图+源码).zip 微信小程序——FlexLayout布局(截图+源码).zip 微信小程序——...
细细品味Flex——新Flex学习手册 技术齐全
ArcGIS Server开发指南——基于Flex和.NET随书光盘
官方资料: PLD设计技巧——提高FLEX器件的系统速度.
本源代码由本人在书:flex基于actionscript源代码(适用Flex 3)基础上修改成适用于Flex 4.6, 修改部分测试通过(13、14章涉及Java,17、18章涉及hibernate,暂没做修改),是学习Flex的入门参考好资料
编译原理实验——flex词法分析 flex源程序
Web GIS开发,flex,ArcGIS Server入门
博文链接:https://hacker47.iteye.com/blog/235758
flex解析浏览器地址,。与浏览器的通信能够让 你建立一个可以超越Flex 应用本身的应用程序...的工具——Adobe Flex Ajax Bridge (FABridge)和Joe Berkovitz 的UrlKit 之类的,但是本章旨 在说明Flex 核心框架里的功能。
本人经常丢手机。所以做了个电话本,是桌面应用程序。好用。需要安装FLEX相关插件才可安装运行。
FLEX——blazeDS原理.pdfFLEX——blazeDS原理.pdf
Selenium 对 Flex 程序的自动化测试 Selenium 是一个自动化测试工具,它可以模拟用户的行为来测试 Web 应用程序。Flex 是一种基于 XML 的开发语言,用于构建 Rich Internet Applications(RIA)。在这篇文章中,...
Flex教程系列之(一) AS3语法——编程基础 http://download.csdn.net/source/1161756 Flex教程系列之(二) AS3语法——流程控制语句 http://download.csdn.net/source/1161804 Flex教程系列之(三) AS3语法——控制...
支持css文件在flex 程序运行时加载
理解_Flex_itemRenderer 理解_Flex_itemRenderer 理解_Flex_itemRenderer
创建第一个Flex应用——设计模式创建第一个Flex应用——设计模式创建第一个Flex应用——设计模式
创建第一个Flex应用——编码模式创建第一个Flex应用——编码模式创建第一个Flex应用——编码模式
《精通Flex 3.0——基于ActionScript 3.0实现》一书源代码。 Flex 3.0 ActionScript 3.0源代码 Flex 3.0源代码。 --------------------------- 第1篇 Flex技术概述 第1章 Flex概述 3 1.1 Flex简介 3 1.2 Flex...
精通Flex 3.0――14.1.3 LCDS的内容结构 精通Flex 3.0――14.2 一个最基本的LCDS应用 精通Flex 3.0――14.3 通过Remoting访问服务端的应用 精通Flex 3.0――14.3.1 Remoting服务介绍 精通Flex 3.0――14.3.2 创建...
学习Flex.flex源程序,很好的啊。