如何在 AS / MXML 代码中读取 AIR 清单文件
Flash Builder 为每个 AIR 项目生成 AppName-app.xml 描述符。那里有许多设置和值,包括以下内容。是否可以在代码中读取这些内容,而无需在运行时显式加载此 XML(即使如此,我也不知道是否可能)?也许 Loader.info 或类似的?
<!-- The name that is displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>ffff</name>
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
<versionNumber>1</versionNumber>
<!-- Description, displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<!-- <description></description> -->
<!-- Copyright information. Optional -->
<!-- <copyright></copyright> -->
Flash Builder generated AppName-app.xml descriptor for every AIR project. There are a number of settings, values there, including below. Is it possible to read these in your code without explicitly loading this XML at runtime (even this I don't know if it's possible)? Maybe Loader.info or similar?
<!-- The name that is displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>ffff</name>
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
<versionNumber>1</versionNumber>
<!-- Description, displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<!-- <description></description> -->
<!-- Copyright information. Optional -->
<!-- <copyright></copyright> -->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以执行以下操作:
因此您不需要在代码中对命名空间进行硬编码。
You can also do as follows :
Thus you don't need to hardcode the namespace in your code.
您尝试读取的内容称为“应用程序描述符”。
它是 XML,但很容易阅读:
请注意,我将命名空间设置为我正在使用的命名空间。您应该确保使用应用程序描述符根中定义的命名空间。
祝你好运!
What you are trying to read is called the "Application Descriptor".
It is XML, but it is very easy read:
Notice that I set the namespace to the one I am using. You should make sure you use the namespace defined in the root of your application descriptor.
Good luck!