適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
com.adobe.icomm.assetplacement.model 

PackageDefinition  - AS3 Asset Placement

套件com.adobe.icomm.assetplacement.model
類別public class PackageDefinition
繼承PackageDefinition Inheritance Object

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A PackageDefinition is an object that wraps the package definition XML file (package.xml). This class is responsible for loading the XML from the package definition file.

The package definition is divided into two broad sections: <controllers> and <assets>. The <controllers> section contains entries for each AssetPlacement component used in the statement: each PromoImage, PromoImageSlideShow, AttachmentLoader, etc. that is added to the statement will have a <controller> entry automatically added to the package definition file by the Interactive Document Plugin. The <controller> entries are meant to be used later in the statement development cycle, to help choose appropriate advertising content to place in each component.

The <assets> section is used at runtime. Each AssetPlacement component will attempt to load assets at runtime. A component looks up the <resource> or <attachment> entry with the matching controller attribute to the components' id attribute and if a match is found attempts to load the source specified.

It is possible to access the various assets of the package definition by calling the appropriate methods; assets are divided into two types: attachments and resources. Attachments are assets that are part of the PDF Navigator and must be accessed through Navigator APIs. Resources are content that can be loaded directly such as images and SWFs. Generally, an asset is recovered through its controller id. The controller id is the key that connects a Flex component (such as a PromoImage) to a resource in the package definition. The component's id property is the lookup key. Note that many assets may be returned for one ID lookup.

This class is a singleton. Calls to the constructor will result in an exception being thrown. In order to use this class, use the PackageDefinitionLoader class.

相關 API 元素



公用屬性
 屬性定義自
  attachments : IList
[唯讀] A list that contains all of <attachment> entries in the package definition, wrapped in Attachment objects.
PackageDefinition
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  controllers : IList
[唯讀] A list that contains all of <controllers> entries in the package definition, wrapped in Controller objects.
PackageDefinition
  packageDefinitionFile : String
[靜態] [唯讀] The file path of the package definition file that underlies this object.
PackageDefinition
  packageLoaded : Boolean
[唯讀] Check to see if the package is loaded.
PackageDefinition
  resources : IList
[唯讀] A list that contains all of the <resource> (non expired) entries in the package definition, wrapped in Resource objects.
PackageDefinition
公用方法
 方法定義自
  
Creates a PackageDefinition object.
PackageDefinition
  
Return a list that contains all of the expired <resource> entries in the package definition, wrapped in Resource objects.
PackageDefinition
  
A convenience method that searches through the attachments and returns a list containing only the attachments that match the given id.
PackageDefinition
  
A convenience method that searches through the contollers and returns the controller with the matching id and XML namespace.
PackageDefinition
  
getResourcesByControllerId(id:String, includeExpired:Boolean = false):IList
A convenience method that searches through the resources and returns a list containing only the resources that match the given id.
PackageDefinition
  
The PackageDefinition version.
PackageDefinition
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
  
Broadcast an IPackageObjectReadyEvent.
PackageDefinition
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
公用常數
 常數定義自
  PACKAGE_VERSION_1_0 : Number = 1.0
[靜態] The package version 1.0.
PackageDefinition
  PACKAGE_VERSION_2_0 : Number = 2.0
[靜態] The package version 2.0.
PackageDefinition
屬性詳細資訊

attachments

屬性
attachments:IList  [唯讀]

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A list that contains all of <attachment> entries in the package definition, wrapped in Attachment objects.



實作
    public function get attachments():IList

相關 API 元素

controllers

屬性 
controllers:IList  [唯讀]

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A list that contains all of <controllers> entries in the package definition, wrapped in Controller objects.



實作
    public function get controllers():IList

相關 API 元素

packageDefinitionFile

屬性 
packageDefinitionFile:String  [唯讀]

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

The file path of the package definition file that underlies this object.



實作
    public static function get packageDefinitionFile():String

packageLoaded

屬性 
packageLoaded:Boolean  [唯讀]

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

Check to see if the package is loaded.



實作
    public function get packageLoaded():Boolean

resources

屬性 
resources:IList  [唯讀]

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A list that contains all of the <resource> (non expired) entries in the package definition, wrapped in Resource objects.



實作
    public function get resources():IList

相關 API 元素

建構函式詳細資料

PackageDefinition

()建構函式
public function PackageDefinition()

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

Creates a PackageDefinition object. The PackageDefinition is meant to be a singleton object - there is only one package definition that wraps the XML package definition file. Callers should not invoke the constructor, which will throw an error. Rather, use the PackageDefinitionLoader class.

相關 API 元素

方法詳細資訊

expiredResources

()方法
public function expiredResources():IList

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

Return a list that contains all of the expired <resource> entries in the package definition, wrapped in Resource objects.

傳回值
IList — A list of all the expired <resource> entries in the package definition, wrapped in Resource objects.

相關 API 元素

getAttachmentsByControllerId

()方法 
public function getAttachmentsByControllerId(id:String):IList

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A convenience method that searches through the attachments and returns a list containing only the attachments that match the given id. The id is usually the id property of a component such as a PromoImage. The key it is looking up corresponds to the controller attribute on the <attachment>'s parent <attachments> node.

參數

id:String — The id of a component, such as a PromoImage.

傳回值
IList — A list of Attachment objects who's controller ID match the given id.

相關 API 元素

getControllerById

()方法 
public function getControllerById(id:String, ns:String = null):Controller

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A convenience method that searches through the contollers and returns the controller with the matching id and XML namespace.

參數

id:String — The id of a controller. This id should match an MXML id in the project as well as a controller id in the <assets> section of the package definition.
 
ns:String (default = null) — The XML namespace of a controller. If null the first controller with the matching the id will be returned.

傳回值
Controller — The Controller object that matches this id and XML namespace or null if there is no matching controller.

相關 API 元素

getResourcesByControllerId

()方法 
public function getResourcesByControllerId(id:String, includeExpired:Boolean = false):IList

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

A convenience method that searches through the resources and returns a list containing only the resources that match the given id. The caller indicates whether to include expired resources via the includeExpired parameter. The id is usually the id property of a component such as a PromoImage. The key it is looking up corresponds to the controller attribute on the <resource>'s parent <resources> node.

參數

id:String — The id of a component, such as a PromoImage.
 
includeExpired:Boolean (default = false) — Boolean whether to include expired resources in the returned list.

傳回值
IList — A list of Resource objects who's controller ID match the given id.

相關 API 元素

getVersion

()方法 
public function getVersion():Number

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 10
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

The PackageDefinition version.

傳回值
Number — The package definition version.

packageObjectReady

()方法 
public function packageObjectReady(packageObject:IPackageObject):void

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 9.5
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

Broadcast an IPackageObjectReadyEvent. When an IPackageObject is ready to be used, it asks the package definition to brodcast the PackageObjectReadyEvent. This allows the hosting application to be notified anytime a new statement object is created.

參數

packageObject:IPackageObject — An IPackageObject that is loaded and ready to be used.

相關 API 元素

常數詳細資訊

PACKAGE_VERSION_1_0

常數
public static const PACKAGE_VERSION_1_0:Number = 1.0

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 10
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

The package version 1.0.

PACKAGE_VERSION_2_0

常數 
public static const PACKAGE_VERSION_2_0:Number = 2.0

語言版本: ActionScript 3.0
產品版本: Asset Placement Building Block 10
執行階段版本: AIR 1.0, Flash Player 9, Flash Player 10

The package version 2.0.





[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。