Packagede.mightypirates.utils.loading
Classpublic class TimeoutLoader
InheritanceTimeoutLoader Inheritance ResourceLoader Inheritance flash.events.EventDispatcher

Base class for loaders of some bundles.

Basically all this class does is wait one frame before firing the finalizing event (completion per default). Subclasses should create the actual instances of the loaded objects.



Public Properties
 PropertyDefined by
 Inheritedbundle : IResourceBundle
The resource bundle that was used spawned this loader.
ResourceLoader
 Inheriteddata : *
The loaded data.
ResourceLoader
 Inheriteddatatype : String
The type of the loaded data, which may be one of the constants specified in ResourceType.
ResourceLoader
 Inheriteddisplay : DisplayObject
This is only used when loading a graphics object (image or swf).
ResourceLoader
 InheritedloaderContext : *
Loader context used for this loading process (may be null).
ResourceLoader
 Inheritedpriority : int
Priority for this loading process.
ResourceLoader
 Inheritedrequest : URLRequest
The original URLRequest used to trigger this load.
ResourceLoader
Protected Properties
 PropertyDefined by
 Inheritedbundle_ : IResourceBundle
Resource bundle that created this instance.
ResourceLoader
  clazz_ : Class
The resource class to create a new instance of
TimeoutLoader
 Inheritedcontext_ : *
Optional context information for the loader.
ResourceLoader
 Inheriteddata_ : *
Data representing the actual loaded resource.
ResourceLoader
 Inheriteddatatype_ : String
Type of the loaded data.
ResourceLoader
 Inheriteddisplay_ : DisplayObject
Wrapper display object container for loaders of visual content.
ResourceLoader
 Inheritedpriority_ : int
Priority for this load.
ResourceLoader
 Inheritedrequest_ : URLRequest
URLRequest that triggered this load.
ResourceLoader
Public Methods
 MethodDefined by
  
TimeoutLoader(bundle:IResourceBundle, request:URLRequest, datatype:String, clazz:Class)
Creates a new timeout based loader with the given properties.
TimeoutLoader
  
unload():void
Unloads the resource loaded via this loader.
TimeoutLoader
Protected Methods
 MethodDefined by
 Inherited
addAsListenerTo(dispatcher:IEventDispatcher):void
Adds this instance as a listener for the following events to the given dispatcher:
Event.COMPLETE, IOErrorEvent.IO_ERROR, SecurityErrorEvent.SECURITY_ERROR and ProgressEvent.PROGRESS
The events are handled by these overridable functions:
handleComplete, handleError, handleSecurityError and handleProgress
By default, they just forward the event by redispatching it via this instance.
ResourceLoader
 Inherited
handleComplete(e:Event):void
Default handler for completion events.
ResourceLoader
 Inherited
handleError(e:ErrorEvent):void
Default handler for error events.
ResourceLoader
 Inherited
handleProgress(e:ProgressEvent):void
Default handler for progress events.
ResourceLoader
  
load():void
Actual loading, after this the data_ of the loader should be set.
TimeoutLoader
 Inherited
removeAsListener(dispatcher:IEventDispatcher):void
This function is called by the default handlers for the completion and error events and removes this loader as a listener from the dispatcher.
ResourceLoader
Property detail
clazz_property
protected var clazz_:Class

The resource class to create a new instance of

Constructor detail
TimeoutLoader()constructor
public function TimeoutLoader(bundle:IResourceBundle, request:URLRequest, datatype:String, clazz:Class)

Creates a new timeout based loader with the given properties.

Parameters
bundle:IResourceBundle
 
request:URLRequest
 
datatype:String
 
clazz:Class
Method detail
load()method
protected function load():void

Actual loading, after this the data_ of the loader should be set. Otherwise an error should be thrown.

unload()method 
public override function unload():void

Unloads the resource loaded via this loader. For some resources which do not require / allow for explicit disposal this may do nothing.