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.
protected var baseURL:String
protected var _content:Object3D
content:Object3D [read-only]
The container with all loaded objects.
Implementation
public function get content():Object3D
protected var loaderContext:LoaderContext
protected var loaderState:int = 0
public function Loader3D()Creates a new instance of the class.
protected function clean():void
See also
public final function close():voidStops 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
protected function closeInternal():void
See also
protected final function complete():void
See also
public final function load(url:String, loaderContext:LoaderContext = null):voidLoads 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:String — The URL of the scene file. |
| |
| loaderContext:LoaderContext (default = null) — LoaderContext for texture files loading |
See also
public final function loadBytes(data:ByteArray, baseUrl:String = null, loaderContext:LoaderContext = null):voidLoads data from a byte array. For reading and parsing data the method parse() is called.
Parameters
| data:ByteArray — the scene's binary data |
| |
| baseUrl:String (default = null) — the base url for textures |
| |
| loaderContext:LoaderContext (default = null) — LoaderContext for texture files loading |
See also
protected function onMainLoadingError(e:ErrorEvent):voidParameters
protected function parse(data:ByteArray):voidParameters
protected function setState(state:int):voidParameters
public final function unload():voidClears internal references to the loaded data. The method doesn't work during loading process.
See also
protected function unloadInternal():void
See also
Event object type: flash.events.Event
Dispatched when all scene data is loaded and parsed.
Event object type: flash.events.IOErrorEvent
Dispatched when an error occurs during loading process.
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.
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.
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.
Event object type: flash.events.SecurityErrorEvent
Dispatched if a call to the load() method violates the security rules.