Packagecom.degrafa.utilities.external
Classpublic class ExternalDataAsset
InheritanceExternalDataAsset Inheritance DegrafaObject
ImplementsIDegrafaObject
SubclassesExternalBitmapData

The ExternalDataAsset class defines the properties for an external data source used at runtime by Degrafa. You can use an ExternalDataAsset object in actionscript - it may be useful to set up preloading, for example, but in mxml use of an ExternalDataAsset is already encapsulated into the Degrafa class that uses the content (when it is ready) by virtue of its source property assignment. The data content provided by an ExternalDataAsset will only be available once the asset from the external url has loaded.



Public Properties
 PropertyDefined by
  bytesLoaded : Number
[read-only] the current bytes loaded for this ExternalDataAsset
ExternalDataAsset
  bytesTotal : Number
[read-only] the bytesTotal for this ExternalDataAsset if known (i.e.
ExternalDataAsset
  content : Object
[read-only] The loaded content (a BitmapData instance) if it is available or false (Boolean) if not available (triggers a loading request if not already requested).
ExternalDataAsset
 Inheriteddocument : Object
The MXML document that created this object.
DegrafaObject
 InheritedenableEvents : Boolean
Enable events for this object.
DegrafaObject
 InheritedhasEventManager : Boolean
Tests to see if a EventDispatcher instance has been created for this object.
DegrafaObject
 Inheritedid : String
The identifier used by document to refer to this object.
DegrafaObject
 InheritedisInitialized : Boolean
DegrafaObject
  loadingLocation : LoadingLocation
ptional loadingLocation reference.
ExternalDataAsset
 Inheritedname : String
The name that refers to this object.
DegrafaObject
 InheritedobjectBindings : Array
DegrafaObject
 Inheritedparent : IDegrafaObject
The current degrafa object parent.
DegrafaObject
  requestBitmapDataAccess : LoaderContext
[static]
ExternalDataAsset
 InheritedsuppressEventProcessing : Boolean
Temporarily suppress event processing for this object.
DegrafaObject
  url : String
the url of the external asset assignable as either a string representing a url relative to an associated LoadingGroup basePath or as a regular url For alternate domain loading or for redundancy support (multple locations) loading on error, use an associated LoadingGroup assigned via the loadingGroup property and make this url relative to the basePath defined in the LoadingGroup
ExternalDataAsset
Protected Properties
 PropertyDefined by
  _data : Object
ExternalDataAsset
  dataType : Class
ExternalDataAsset
 InheritedeventDispatcher : EventDispatcher
EventDispatcher instance for this object.
DegrafaObject
  _url : String
ExternalDataAsset
Public Methods
 MethodDefined by
  
ExternalDataAsset(url:String = null, totalBytes:Number, loader:Class = null)
Constructor

The ExternalDataAsset constructor has one optional argument for url(s) and a second optional argument to specifiy filesize for an external bitmap (useful when considered as part of a collection to preload if the data is available).

ExternalDataAsset
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
DegrafaObject
 Inherited
dispatchEvent(evt:Event):Boolean
Dispatches an event into the event flow.
DegrafaObject
 Inherited
dispatchPropertyChange(bubbles:Boolean = false, property:Object = null, oldValue:Object = null, newValue:Object = null, source:Object = null):Boolean
Dispatches an property change event into the event flow.
DegrafaObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
DegrafaObject
 Inherited
initChange(property:String, oldValue:Object, newValue:Object, source:Object):void
Helper function for dispatching property changes
DegrafaObject
 Inherited
initialized(document:Object, id:String):void
Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized.
DegrafaObject
  
load():void
load this item, using LoadingGroup settings if this ExternalDataAsset is associated with a LoadingGroup instance
ExternalDataAsset
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
DegrafaObject
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
DegrafaObject
Protected Methods
 MethodDefined by
  
cleanUp():void
ExternalDataAsset
  
getUniqueInstance(url:String = null, loc:LoadingLocation = null, clazz:Class = null):ExternalDataAsset
[static] static method to prevent multiple instances referring to the same external asset this avoids creation of multiple instances of the same loaded data (multiple instances remain possible if required, by simply by using the constructor)
ExternalDataAsset
  
processLoad(_loader:Object):String
ExternalDataAsset
  
reset():Boolean
resets the status to waiting prior to load, stopping any current load in progress.
ExternalDataAsset
Events
 EventSummaryDefined by
 Inherited  DegrafaObject
 Inherited  DegrafaObject
Public Constants
 ConstantDefined by
  STATUS_DATA_ERROR : String = "itemDataError"
[static]
ExternalDataAsset
  STATUS_IDENTIFIED : String = "itemIdentified"
[static]
ExternalDataAsset
  STATUS_INITIALIZING : String = "itemInitializing"
[static]
ExternalDataAsset
  STATUS_LOAD_ERROR : String = "itemLoadError"
[static]
ExternalDataAsset
  STATUS_PROGRESS : String = "itemLoadProgress"
[static]
ExternalDataAsset
  STATUS_READY : String = "itemReady"
[static]
ExternalDataAsset
  STATUS_REQUESTED : String = "itemRequested"
[static]
ExternalDataAsset
  STATUS_SECURITY_ERROR : String = "itemSecurityError"
[static]
ExternalDataAsset
  STATUS_STARTED : String = "itemLoadStarted"
[static]
ExternalDataAsset
  STATUS_WAITING : String = "itemWaiting"
[static]
ExternalDataAsset
  TYPE_IMAGE_GIF : String = "image/gif"
[static]
ExternalDataAsset
  TYPE_IMAGE_JPEG : String = "image/jpeg"
[static]
ExternalDataAsset
  TYPE_IMAGE_PNG : String = "image/png"
[static]
ExternalDataAsset
  TYPE_SWF : String = "application/x-shockwave-flash"
[static]
ExternalDataAsset
  TYPE_UNKNOWN : String
[static]
ExternalDataAsset
Property detail
bytesLoadedproperty
bytesLoaded:Number  [read-only]

the current bytes loaded for this ExternalDataAsset

Implementation
    public function get bytesLoaded():Number
bytesTotalproperty 
bytesTotal:Number  [read-only]

the bytesTotal for this ExternalDataAsset if known (i.e. verified during an actual load, or the value provided if pre-assigned through the constructor when instantiated) the value returned is NaN for unassigned, unverified (from actual file data) values

Implementation
    public function get bytesTotal():Number
contentproperty 
content:Object  [read-only]

The loaded content (a BitmapData instance) if it is available or false (Boolean) if not available (triggers a loading request if not already requested).

Implementation
    public function get content():Object
_dataproperty 
protected var _data:Object
dataTypeproperty 
protected var dataType:Class
loadingLocationproperty 
loadingLocation:LoadingLocation  [read-write]

ptional loadingLocation reference. Using a LoadingLocation simplifies management of groups of bitmap assets from other domains y permitting different locations (alternate domains used for loading) to be specified once in code f a loadingLocation is specified the url property in the ExternalDataAsset must be relative to the basepath specified in the LoadingLocation f an ExternalDataAsset's domain has a non-default policy file, a LoadingLocation must be used to specify the explicit location and ame of the cross-domain file that grants access. An ExternalDataAsset without a LoadingLocation will only check for permission n the default location and name (web document root, crossdomain.xml) for permission to access the remote file's BitmapData.

Implementation
    public function get loadingLocation():LoadingLocation
    public function set loadingLocation(value:LoadingLocation):void
requestBitmapDataAccessproperty 
public static var requestBitmapDataAccess:LoaderContext
_urlproperty 
protected var _url:String
urlproperty 
url:String  [read-write]

the url of the external asset assignable as either a string representing a url relative to an associated LoadingGroup basePath or as a regular url For alternate domain loading or for redundancy support (multple locations) loading on error, use an associated LoadingGroup assigned via the loadingGroup property and make this url relative to the basePath defined in the LoadingGroup

Implementation
    public function get url():String
    public function set url(value:String):void
Constructor detail
ExternalDataAsset()constructor
public function ExternalDataAsset(url:String = null, totalBytes:Number, loader:Class = null)

Constructor

The ExternalDataAsset constructor has one optional argument for url(s) and a second optional argument to specifiy filesize for an external bitmap (useful when considered as part of a collection to preload if the data is available). The url argument can be either a string for a single url or an array of url strings for backup.

Parameters
url:String (default = null) — a single url as a string. If a loadingGroup association is made in the loadingGroup property the url should be relative to the LoadingGroup basePath : use a LoadingGroup for fallback urls to provide redundancy under error conditions
 
totalBytes:Number — an [optional] specification for the total bytes to be loaded for this item, only available through the constructor (actionscript use)
 
loader:Class (default = null)
Method detail
cleanUp()method
protected function cleanUp():void
getUniqueInstance()method 
protected static function getUniqueInstance(url:String = null, loc:LoadingLocation = null, clazz:Class = null):ExternalDataAsset

static method to prevent multiple instances referring to the same external asset this avoids creation of multiple instances of the same loaded data (multiple instances remain possible if required, by simply by using the constructor)

Parameters
url:String (default = null) — the url to the external asset (must be relative if a LoadingLocation is used)
 
loc:LoadingLocation (default = null) — an optional LoadingLocation
 
clazz:Class (default = null)

Returns
ExternalDataAsset
load()method 
public function load():void

load this item, using LoadingGroup settings if this ExternalDataAsset is associated with a LoadingGroup instance

processLoad()method 
protected function processLoad(_loader:Object):StringParameters
_loader:Object

Returns
String
reset()method 
protected function reset():Boolean

resets the status to waiting prior to load, stopping any current load in progress.

Returns
Boolean — Boolean value of true if status was anything other than waiting when called, otherwise false
Constant detail
STATUS_DATA_ERRORconstant
public static const STATUS_DATA_ERROR:String = "itemDataError"
STATUS_IDENTIFIEDconstant 
public static const STATUS_IDENTIFIED:String = "itemIdentified"
STATUS_INITIALIZINGconstant 
public static const STATUS_INITIALIZING:String = "itemInitializing"
STATUS_LOAD_ERRORconstant 
public static const STATUS_LOAD_ERROR:String = "itemLoadError"
STATUS_PROGRESSconstant 
public static const STATUS_PROGRESS:String = "itemLoadProgress"
STATUS_READYconstant 
public static const STATUS_READY:String = "itemReady"
STATUS_REQUESTEDconstant 
public static const STATUS_REQUESTED:String = "itemRequested"
STATUS_SECURITY_ERRORconstant 
public static const STATUS_SECURITY_ERROR:String = "itemSecurityError"
STATUS_STARTEDconstant 
public static const STATUS_STARTED:String = "itemLoadStarted"
STATUS_WAITINGconstant 
public static const STATUS_WAITING:String = "itemWaiting"
TYPE_IMAGE_GIFconstant 
public static const TYPE_IMAGE_GIF:String = "image/gif"
TYPE_IMAGE_JPEGconstant 
public static const TYPE_IMAGE_JPEG:String = "image/jpeg"
TYPE_IMAGE_PNGconstant 
public static const TYPE_IMAGE_PNG:String = "image/png"
TYPE_SWFconstant 
public static const TYPE_SWF:String = "application/x-shockwave-flash"
TYPE_UNKNOWNconstant 
public static const TYPE_UNKNOWN:String