Flex的MXML文件结构
下面是一个MXML <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
</mx:Application>
第一行声明XML文件采用的语法版本号和文件采用的编码格式。mx:Application标签是一个特殊的标签。在每一个MXML文件,但作为程序入口的运行文件只有一个,主文件的标示是根节点为mx:Application,一个程序中出现一个mx:Application节点。还有一个属性xmlns:mx=http://www.adobe.com/2006/mxml,表示将mx定义为XML的命名空间。xmlns标签专门用来定义XML的命名空间,XML命名空间可以用来定义一套独立的XML标签,并且为这些标签指定特殊的解析方式。比如XML文件中默认的标签格式为:<Button>node</Button>,这里的Button节点作为一个普通的文本节点,没有特殊的意义。定义命名空间后,在节点上加上空间前缀:<mx:Button></mx:Button>这时候就代表mx空间下的Button对象。 Mx命名空间对应的路径是”http:// www.adobe.com/2006/mxml”,Flex的配置文件中将这个路径定义为一个全局资源标识符,并对应了一个XML文件。在这个文件中,列出了mx命名空间下的所有标签。在Flex SDK
<namespaces> <namespace> <uri>http://www.adobe.com/2006/mxml</uri> <manifest>mxml-manifest.xml</manifest> </namespace> </namespaces>
从上面可以发现,” http://www.adobe.com/2006/mxml”这个URI和mxml-manifest.xml文件对应,打开该文件,该文件列出了MXML中的所有标签与标签关联的类文件路径。 <?xml version="1.0"?>
<componentPackage>
<component id="FileSystemComboBox" class="mx.controls.FileSystemComboBox"/> <component id="FileSystemDataGrid" class="mx.controls.FileSystemDataGrid"/> 。。。。。。。 <component id="WebService" class="mx.rpc.soap.mxml.WebService"/> <component id="WebServiceOperation" class="mx.rpc.soap.mxml.Operation"/>
</componentPackage>
在开发中,当程序有很多MXML文件和AS文件时,为了方便调用,我们可以将功能相似的文件放在一个文件夹中,定义一个命名空间在定义命名空间时,为了方便,很一般直接指定命名空间包括的标签路径。比如: xmlns:myComp=”components.*” 上面使用了通配符”*”, components目录下所有的MXML文件个ActionScript类文件都被包括在myComp命名空间下。例如components中有一个Loginpanel.mxml,则程序中调用这个文件时,代码如下 <myComp: Loginpanel></myComp: Loginpanel> myComp下的标签被自动指向components文件,当标签数量较多而且分布在不同文件夹时,可以效仿Flex配置文件的做法,使用XML文件来描述。 |
ref:hi.baidu.com/flexok/blog/item/83397ca93c70dc044a36d61b.html
Sep 28, 2022 02:16:08 AM Leading educational institutions and subject experts of the state provided sample guess paper with practice question bank in chapter wise important questions and answer solutions through newspapers and model sets, Bihar Board 10th Social Model Paper we have recommended to every student can download expert questions of Bihar Board 10th Model Paper 2023 for Social Science to practice regular mock test.Leading educational institutions and subject experts of the state provided sample guess paper with practice question bank in chapter wise important questions and answer solutions through newspapers and model sets.
Sep 23, 2023 05:29:18 PM
Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. Delaware startup package
Jan 12, 2024 01:39:12 AM
Board Model Papers 2024 Download with Suggestions for 10th Class Textbooks 2024 Pdf Download and SSLC New Syllabus Sample Question Paper 2024 and different types of model papers boardmodelpaper.com and question papers for following the website and Arts, Science, Commerce Stream Subject Wise Solved Question Bank for Hindi & English Medium Students with Exam Pattern & Blueprint and subject Wise with 11th & 12th Question Bank 2024 for General & Vocational Course Languages & Subjects Important Question for the above link.
Aug 13, 2024 07:20:53 PM
Amazing, this is great as you want to learn more, I invite to This is my page. Kissimmee Pest Control
Aug 13, 2024 07:21:06 PM
It is especially decent, though look into the tips during this home address. Orlando Pest Control
Aug 13, 2024 07:21:24 PM
I invite you to the page where you can read with interesting information on similar topics. Oviedo Pest Control
Aug 24, 2024 01:27:01 AM
At this point you'll find out what is important, it all gives a url to the appealing page: Tampa Pest Control
Oct 08, 2024 07:27:51 PM
These you will then see the most important thing, the application provides you a website a powerful important internet page: online cpa services
Oct 16, 2024 08:43:20 PM
Hi there, I discovered your blog per Google bit searching for such kinda educational advise moreover your inform beholds very remarkable for me. فتح اقفال
Oct 26, 2024 01:39:26 AM
Profit primarily prime quality items -- you can understand them all within: minisplit installer
Oct 26, 2024 01:39:35 AM
Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... portland
Oct 26, 2024 01:39:46 AM
Beaver says I also have such interest, you can read my profile here: Japanese gel manicure