| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <apiPackage id="spark.modules"><apiName>spark.modules</apiName><apiDetail/><apiClassifier id="spark.modules:ModuleLoader"><apiName>ModuleLoader</apiName><shortdesc> |
| ModuleLoader 组件的行为方式与 SWFLoader 极为相似,不同的是它需要遵循与加载内容间的合同要求。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion><discouragedForProfiles><DiscouragedForProfile name="mobileDevice" owner="spark.modules:ModuleLoader"> |
| <description> |
| AIR 手机应用程序不支持模块。 |
| </description> |
| </DiscouragedForProfile></discouragedForProfiles><DefaultProperty name="mxmlContent"/></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseInterface>mx.core:INavigatorContent</apiBaseInterface><apiBaseClassifier>spark.components:Group</apiBaseClassifier></apiClassifierDef><apiDesc> |
| ModuleLoader 组件的行为方式与 SWFLoader 极为相似,不同的是它需要遵循与加载内容间的合同要求。本合同规定子级 SWF 文件实现 IFlexModuleFactory,并且可以按需使用实现的 factory 创建子类的多个实例。 |
| <p>ModuleLoader 已连接到延迟例示,请确保只有一个模块 SWF 文件副本使用 ModuleManager singleton 通过网络进行传输。</p> |
| |
| </apiDesc><example conref="ModuleLoaderExample.mxml"><swfblock conref="examples/ModuleLoaderExample.swf"/></example><example conref="ModuleVerticalLayout.mxml"/><example conref="ModuleHorizontalLayout.mxml"/></apiClassifierDetail><related-links><link href="" invalidHref="mx.modules.ModuleManager.xml"><linktext>mx.modules.ModuleManager</linktext></link><link href="spark.modules.xml#Module"><linktext>spark.modules.Module</linktext></link><link href="" invalidHref="mx.controls.SWFLoader.xml"><linktext>mx.controls.SWFLoader</linktext></link></related-links><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.ModuleEvent.UNLOAD_unload"><apiName>unload</apiName><shortdesc> |
| 卸载模块数据时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.ModuleEvent.UNLOAD</apiEventType><adobeApiEventClassifier>mx.events.ModuleEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 卸载模块数据时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.ModuleEvent.PROGRESS_progress"><apiName>progress</apiName><shortdesc> |
| 加载模块时以固定间隔分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.ModuleEvent.PROGRESS</apiEventType><adobeApiEventClassifier>mx.events.ModuleEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 加载模块时以固定间隔分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.ModuleEvent.ERROR_error"><apiName>error</apiName><shortdesc> |
| 模块引发错误时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.ModuleEvent.ERROR</apiEventType><adobeApiEventClassifier>mx.events.ModuleEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 模块引发错误时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.ModuleEvent.READY_ready"><apiName>ready</apiName><shortdesc> |
| 完成加载模块时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.ModuleEvent.READY</apiEventType><adobeApiEventClassifier>mx.events.ModuleEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 完成加载模块时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.ModuleEvent.SETUP_setup"><apiName>setup</apiName><shortdesc> |
| 模块相关信息可用(与 info() 方法一起使用)但模块尚未准备就绪时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.ModuleEvent.SETUP</apiEventType><adobeApiEventClassifier>mx.events.ModuleEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 模块相关信息可用(与 <codeph>info()</codeph> 方法一起使用)但模块尚未准备就绪时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.FlexEvent.URL_CHANGED_urlChanged"><apiName>urlChanged</apiName><shortdesc> |
| 给 ModuleLoader 新的 URL 时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.FlexEvent.URL_CHANGED</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| 给 ModuleLoader 新的 URL 时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="spark.modules:ModuleLoader_mx.events.FlexEvent.LOADING_loading"><apiName>loading</apiName><shortdesc> |
| ModuleLoader 开始加载 URL 时分派。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>mx.events.FlexEvent.LOADING</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc> |
| ModuleLoader 开始加载 URL 时分派。 |
| </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="spark.modules:ModuleLoader:ModuleLoader"><apiName>ModuleLoader</apiName><shortdesc> |
| 构造函数。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc> |
| 构造函数。 |
| |
| </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="spark.modules:ModuleLoader:loadModule"><apiName>loadModule</apiName><shortdesc> |
| 加载模块。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>url</apiItemName><apiType value="String"/><apiData>null</apiData><apiDesc>模块的位置,以 URL 表示。这是一个可选参数。如果此参数为 null,则将使用 <codeph>url</codeph> 属性的值。如果提供了 url 参数,则会将 <codeph>url</codeph> 属性更新为该 url 的值。 |
| |
| </apiDesc></apiParam><apiParam><apiItemName>bytes</apiItemName><apiType value="flash.utils:ByteArray"/><apiData>null</apiData><apiDesc>一个 ByteArray 对象。ByteArray 应该包含代表已编译 Module 的 SWF 文件的字节数。可以使用 URLLoader 类获得 ByteArray 对象。如果指定了此参数,则将从 ByteArray 加载模块,而 url 参数将用于在 <codeph>ModuleManager.getModule()</codeph> 方法中标识模块,并且必须为非 null。如果此参数为 null,则将从 url加载模块(如果 url 为非 null,则从 url 参数加载,否则从作为回退的 url 属性加载)。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc> |
| 加载模块。完成模块加载时,ModuleLoader 会使用 <codeph>addElement()</codeph> 方法将其添加为子代。延迟例示通常会触发此事件。 |
| |
| <p>如果已加载模块,则此方法不起任何作用。它不会再次加载模块。</p> |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="spark.modules:ModuleLoader:unloadModule"><apiName>unloadModule</apiName><shortdesc> |
| 卸载模块并将其设置为 null。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc> |
| 卸载模块并将其设置为 <codeph>null</codeph>。如果之前已将该模块的实例添加为子级,则此方法会针对子级调用 <codeph>removeChild()</codeph> 方法。 |
| <p>如果模块不存在或尚未加载模块,则此方法不会执行。</p> |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiValue id="spark.modules:ModuleLoader:applicationDomain"><apiName>applicationDomain</apiName><shortdesc> |
| 将模块加载到的应用程序域。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiType value="flash.system:ApplicationDomain"/></apiValueDef><apiDesc> |
| 将模块加载到的应用程序域。应用程序域用于划分位于同一个安全域中的类。它们允许同一个类存在多个定义,并且允许子级重用父级定义。 |
| |
| </apiDesc></apiValueDetail><related-links><link href="" invalidHref="flash.system.ApplicationDomain.xml"><linktext>flash.system.ApplicationDomain</linktext></link><link href="" invalidHref="flash.system.SecurityDomain.xml"><linktext>flash.system.SecurityDomain</linktext></link></related-links></apiValue><apiValue id="spark.modules:ModuleLoader:child"><apiName>child</apiName><shortdesc> |
| 基于模块工厂创建的 IVisualElement。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiType value="mx.core:IVisualElement"/></apiValueDef><apiDesc> |
| 基于模块工厂创建的 IVisualElement。 |
| |
| </apiDesc></apiValueDetail></apiValue><apiValue id="spark.modules:ModuleLoader:creationPolicy:get"><apiName>creationPolicy</apiName><shortdesc> |
| </shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiType value="String"/><apiDefaultValue>auto |
| |
| </apiDefaultValue></apiValueDef><apiDesc> |
| </apiDesc></apiValueDetail><apiInheritDoc/></apiValue><apiValue id="spark.modules:ModuleLoader:icon:get"><apiName>icon</apiName><shortdesc> |
| 由某些导航器容器显示的图标的 Class,用于代表此 Container。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty isBindable="true" name="iconChanged"/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiType value="Class"/><apiDefaultValue>null |
| |
| </apiDefaultValue></apiValueDef><apiDesc> |
| 由某些导航器容器显示的图标的 Class,用于代表此 Container。 |
| <p>例如,如果此 Container 是 TabNavigator 的一个子项,则此图标将显示在相应的选项卡中。如果此 Container 是 Accordion 的一个子项,则此图标将显示在相应的标题中。</p> |
| <p>要将图标嵌入到 SWF 文件中,请使用 @Embed() MXML 编译器指令:</p> |
| <pre> |
| icon="@Embed('filepath')" |
| </pre> |
| <p>图像可以是 JPEG、GIF、PNG、SVG 或 SWF 文件。</p> |
| </apiDesc></apiValueDetail></apiValue><apiValue id="spark.modules:ModuleLoader:label:get"><apiName>label</apiName><shortdesc> |
| 由某些导航器容器显示的文本,用于代表此 Container。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty isBindable="true" name="labelChanged"/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiType value="String"/><apiDefaultValue>"" |
| |
| </apiDefaultValue></apiValueDef><apiDesc> |
| 由某些导航器容器显示的文本,用于代表此 Container。 |
| <p>例如,如果此 Container 是 TabNavigator 的一个子项,则此字符串将显示在相应的选项卡中。如果此 Container 是 Accordion 的一个子项,则此字符串将显示在相应的标题中。</p> |
| </apiDesc></apiValueDetail></apiValue><apiValue id="spark.modules:ModuleLoader:url:get"><apiName>url</apiName><shortdesc> |
| 模块的位置,以 URL 表示。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiType value="String"/></apiValueDef><apiDesc> |
| 模块的位置,以 URL 表示。 |
| |
| </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="spark.modules:Module"><apiName>Module</apiName><shortdesc> |
| 基于 MXML 的动态可加载模块的基类。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion><discouragedForProfiles><DiscouragedForProfile name="mobileDevice" owner="spark.modules:Module"> |
| <description> |
| AIR 手机应用程序不支持模块。 |
| </description> |
| </DiscouragedForProfile></discouragedForProfiles><DefaultProperty name="mxmlContentFactory"/></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseInterface>mx.modules:IModule</apiBaseInterface><apiBaseClassifier>spark.components:SkinnableContainer</apiBaseClassifier></apiClassifierDef><apiDesc> |
| 基于 MXML 的动态可加载模块的基类。通过在 MXML 文件中使用 <codeph><s:Module></codeph> 标签,可以在 MXML 中扩展此类,如下例所示: |
| |
| <pre> |
| <?xml version="1.0"?> |
| <!-- This module loads an image. --> |
| <s:Module width="100%" height="100%" xmlns:s="library://ns.adobe.com/flex/spark"> |
| |
| <s:Image source="trinity.gif"/> |
| |
| </s:Module> |
| </pre> |
| |
| </apiDesc></apiClassifierDetail><related-links><link href="" invalidHref="mx.modules.ModuleManager.xml"><linktext>mx.modules.ModuleManager</linktext></link><link href="spark.modules.xml#ModuleLoader"><linktext>spark.modules.ModuleLoader</linktext></link></related-links><apiConstructor id="spark.modules:Module:Module"><apiName>Module</apiName><shortdesc> |
| 构造函数。</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.2"/><apiPlatform description="" name="AIR" version="2.5"/><apiTool description="" name="Flex" version="4.5"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc> |
| 构造函数。 |
| |
| </apiDesc></apiConstructorDetail></apiConstructor></apiClassifier></apiPackage> |