Packagealternativa.engine3d.loaders
Classpublic class Loader3D
InheritanceLoader3D Inheritance flash.events.EventDispatcher
SubclassesLoader3DS, LoaderOBJ

The base class for loaders. Implements loading of the main scene file and includes methods which can be overriden by descendants to implement specific functionality.



Public Properties
 PropertyDefined by
  content : Object3D
[read-only] The container with all loaded objects.
Loader3D
Protected Properties
 PropertyDefined by
  baseURL : String
Loader3D
  _content : Object3D
Loader3D
  loaderContext : LoaderContext
Loader3D
  loaderState : int = 0
Loader3D
Public Methods
 MethodDefined by
  
Creates a new instance of the class.
Loader3D
  
close():void
Stops current loading process.
Loader3D
  
load(url:String, loaderContext:LoaderContext = null):void
Loads a scene from specified URL.
Loader3D
  
loadBytes(data:ByteArray, baseUrl:String = null, loaderContext:LoaderContext = null):void
Loads data from a byte array.
Loader3D
  
unload():void
Clears internal references to the loaded data.
Loader3D
Protected Methods
 MethodDefined by
  
clean():void
Loader3D
  
Loader3D
  
complete():void
Loader3D
  
onMainLoadingError(e:ErrorEvent):void
Loader3D
  
parse(data:ByteArray):void
Loader3D
  
setState(state:int):void
Loader3D
  
Loader3D
Events
 EventSummaryDefined by
   Dispatched when all scene data is loaded and parsed.Loader3D
   Dispatched when an error occurs during loading process.Loader3D
   Dispatched when a loading process stage is completed.Loader3D
   Dispatched when data is recieved during loading process.Loader3D
   Dispatched when a loading process stage is started.Loader3D
   Dispatched when a call of the load() method violates the security rules.Loader3D
Property detail
baseURLproperty
protected var baseURL:String

_contentproperty 
protected var _content:Object3D

contentproperty 
content:Object3D  [read-only]

The container with all loaded objects.

Implementation
    public function get content():Object3D
loaderContextproperty 
protected var loaderContext:LoaderContext

loaderStateproperty 
protected var loaderState:int = 0

Constructor detail
Loader3D()constructor
public function Loader3D()

Creates a new instance of the class.

Method detail
clean()method
protected function clean():void

See also

close()method 
public final function close():void

Stops current loading process. The base implementation stops loading of the main scene file. Descendants have to override the method closeInternal to stop their own loading processes. If there is no active loading process, the method shoudn't do anything.

See also

closeInternal()method 
protected function closeInternal():void

See also

complete()method 
protected final function complete():void

See also

load()method 
public final function load(url:String, loaderContext:LoaderContext = null):void

Loads a scene from specified URL. If another loading is in progress it is canceled. When the file is successfully loaded, the method parse() is called to parse the data.

Parameters
url:StringThe URL of the scene file.
 
loaderContext:LoaderContext (default = null)LoaderContext for texture files loading

See also

loadBytes()method 
public final function loadBytes(data:ByteArray, baseUrl:String = null, loaderContext:LoaderContext = null):void

Loads data from a byte array. For reading and parsing data the method parse() is called.

Parameters
data:ByteArraythe scene's binary data
 
baseUrl:String (default = null)the base url for textures
 
loaderContext:LoaderContext (default = null)LoaderContext for texture files loading

See also

onMainLoadingError()method 
protected function onMainLoadingError(e:ErrorEvent):void

Parameters
e:ErrorEvent
parse()method 
protected function parse(data:ByteArray):void

Parameters
data:ByteArray
setState()method 
protected function setState(state:int):void

Parameters
state:int
unload()method 
public final function unload():void

Clears internal references to the loaded data. The method doesn't work during loading process.

See also

unloadInternal()method 
protected function unloadInternal():void

See also

Event detail
completeevent 
Event object type: flash.events.Event

Dispatched when all scene data is loaded and parsed.

ioErrorevent  
Event object type: flash.events.IOErrorEvent

Dispatched when an error occurs during loading process.

loadingCompleteevent  
Event object type: alternativa.engine3d.loaders.events.LoaderEvent
LoaderEvent.type property = alternativa.engine3d.loaders.events.LoaderEvent.LOADING_COMPLETE

Dispatched when a loading process stage is completed.

The value of the type property of a loadingComplete event object.
loadingProgressevent  
Event object type: alternativa.engine3d.loaders.events.LoaderProgressEvent
LoaderProgressEvent.type property = alternativa.engine3d.loaders.events.LoaderProgressEvent.LOADING_PROGRESS

Dispatched when data is recieved during loading process.

The value of the type property of a loadingProgress event object.
loadingStartevent  
Event object type: alternativa.engine3d.loaders.events.LoaderEvent
LoaderEvent.type property = alternativa.engine3d.loaders.events.LoaderEvent.LOADING_START

Dispatched when a new loading process stage is started.

The value of the type property of a loadingStart event object.
securityErrorevent  
Event object type: flash.events.SecurityErrorEvent

Dispatched if a call to the load() method violates the security rules.