Packagecom.gaiaframework.api
Interfacepublic interface IAsset extends flash.events.IEventDispatcher
SubinterfacesIByteArray, IDisplayObject, IJson, INetStream, ISound, IStyleSheet, IText, IXml

This is the interface of the abstract asset class for all concrete asset classes.

See also

Assets Documentation


Public Properties
 PropertyDefined by
  bytes : int
[read-only] Returns the bytes attribute value set in the site.xml for byte-accurate preloading.
IAsset
  id : String
[read-only] Returns the ID as set in site.xml.
IAsset
  node : XML
[read-only] Returns the raw XML node of the asset
IAsset
  order : int
[read-only] Returns the load order and position of the asset relative to other assets of the page.
IAsset
  percentLoaded : Number
[read-only] Returns the bytesLoaded / bytesTotal.
IAsset
  preloadAsset : Boolean
Specifies a value of true if the asset is set to preload, or false if it is on-demand.
IAsset
  showProgress : Boolean
Specifies whether the asset will cause the asset preloader to appear when loaded on-demand.
IAsset
  src : String
Returns the source path of the asset.
IAsset
  title : String
Specifies the title of the asset.
IAsset
Public Methods
 MethodDefined by
  
abort():void
Used to manually abort an on-demand asset load.
IAsset
  
Returns the loaded bytes of the file.
IAsset
  
Returns the total bytes of the file.
IAsset
  
load(... args):void
Used to load assets on-demand.
IAsset
Events
 EventSummaryDefined by
   Dispatched when the asset is finished loading.IAsset
Property detail
bytesproperty
bytes:int  [read-only]

Returns the bytes attribute value set in the site.xml for byte-accurate preloading.

Implementation
    public function get bytes():int
idproperty 
id:String  [read-only]

Returns the ID as set in site.xml. Assets need unique IDs per page and the IDs cannot be a reserved property or function name of MovieClip objects. The ID must be alphanumeric (no hyphens or underscores), and must start with a letter, not a number.

Implementation
    public function get id():String
nodeproperty 
node:XML  [read-only]

Returns the raw XML node of the asset

Implementation
    public function get node():XML
orderproperty 
order:int  [read-only]

Returns the load order and position of the asset relative to other assets of the page. SEOAssets are always 0.

Implementation
    public function get order():int
percentLoadedproperty 
percentLoaded:Number  [read-only]

Returns the bytesLoaded / bytesTotal.

Implementation
    public function get percentLoaded():Number
preloadAssetproperty 
preloadAsset:Boolean  [read-write]

Specifies a value of true if the asset is set to preload, or false if it is on-demand.

Implementation
    public function get preloadAsset():Boolean
    public function set preloadAsset(value:Boolean):void
showProgressproperty 
showProgress:Boolean  [read-write]

Specifies whether the asset will cause the asset preloader to appear when loaded on-demand. true if the asset will show the asset preloader (default), false if not. In the site.xml, this property is represented with the progress attribute.

Implementation
    public function get showProgress():Boolean
    public function set showProgress(value:Boolean):void
srcproperty 
src:String  [read-write]

Returns the source path of the asset.

Implementation
    public function get src():String
    public function set src(value:String):void
titleproperty 
title:String  [read-write]

Specifies the title of the asset.

Implementation
    public function get title():String
    public function set title(value:String):void
Method detail
abort()method
public function abort():void

Used to manually abort an on-demand asset load.

getBytesLoaded()method 
public function getBytesLoaded():int

Returns the loaded bytes of the file.

Returns
int
getBytesTotal()method 
public function getBytesTotal():int

Returns the total bytes of the file.

Returns
int
load()method 
public function load(... args):void

Used to load assets on-demand. Sound and NetStream assets will start playing immediately. The args are for internal Gaia use only.

Parameters
... args
Event detail
assetCompleteevent 
Event object type: com.gaiaframework.events.AssetEvent

Dispatched when the asset is finished loading. Used with on-demand assets. The target or asset property