Asset3DLibrary enforces a singleton pattern and is not intended to be instanced.

It's purpose is to allow access to the default library bundle through a set of static shortcut methods.


Has static methods:

addEventListener(type, listener, useCapture, priority, useWeakReference)

Add Asset3DEvent listener

type - The type of the event (Asset3DEvent), accessible as asset type Asset3DType, string.

listener - the listener function that processes the event. This function must accept an Asset3DEvent object as its only parameter and must return nothing

useCapture -  (recommended default = false) - Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with useCapture set to true, then again with useCapture set to false.

priority - (recommended default = 0) - The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0.

useWeakReference - (recommended default = false) - Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not

removeEventListener(type, listener, useCapture)

Removes a Asset3DEvent listener from the object.

type - The type of the event (Asset3DEvent)

listener - the listener function that processes the event

useCapture - (recommended default = false) - Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false.

hasEventListener(type)

Checks whether the object has any listeners registered for a specific type of event.

type - The type of the event (Asset3DEvent), accessible as asset type Asset3DType, string.

willTrigger(type)

Checks whether an event listener is registered with this object for the specified event type.

type - The type of the event (Asset3DEvent), accessible as asset type Asset3DType, string.

load(req, context, ns, parser)

Loads a file and (optionally) all of its dependencies. Returns AssetLoaderToken.

req - The URLRequest object containing the URL of the file to be loaded.

context - an optional context object providing additional parameters for loading (default nil) (AssetLoaderContext)

ns - An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets, string (default nil)

parser - An optional parser object (ParserBase) for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. (default nil)

loadData(data, context, ns, parser)

Loads a resource from existing data in memory. Returns AssetLoaderToken.

data - The data object containing all resource information.

context - an optional context object providing additional parameters for loading (default nil) (AssetLoaderContext)

ns - An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets, string (default nil)

parser - An optional parser object (ParserBase) for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. (default nil)

stopLoad()

Stop assets loading


getAsset(name, ns)

Returns IAsset: AnimationNodeBase, AnimationSetBase, AnimatorBase, BitmapDataAsset, EffectMethodBase, Geometry, LightPickerBase, MaterialBase, Mesh, ObjectContainer3D, ShadowMapMethodBase, Skeleton, SkeletonPose, TextureProxyBase

name - asset name

ns - An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets, string (default nil)

addAsset(asset)

Add asset.

asset - IAsset: AnimationNodeBase, AnimationSetBase, AnimatorBase, BitmapDataAsset, EffectMethodBase, Geometry, LightPickerBase, MaterialBase, Mesh, ObjectContainer3D, ShadowMapMethodBase, Skeleton, SkeletonPose, TextureProxyBase

removeAsset(asset, dispose)

Remove asset.

asset - IAsset: AnimationNodeBase, AnimationSetBase, AnimatorBase, BitmapDataAsset, EffectMethodBase, Geometry, LightPickerBase, MaterialBase, Mesh, ObjectContainer3D, ShadowMapMethodBase, Skeleton, SkeletonPose, TextureProxyBase

dispose - Defines whether the assets should also be disposed. (default true)

removeAssetByName(name, ns, dispose)

Remove asset by name and return IAsset: AnimationNodeBase, AnimationSetBase, AnimatorBase, BitmapDataAsset, EffectMethodBase, Geometry, LightPickerBase, MaterialBase, Mesh, ObjectContainer3D, ShadowMapMethodBase, Skeleton, SkeletonPose, TextureProxyBase

name - asset name

ns - An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets, string (default nil)

dispose - Defines whether the assets should also be disposed. (default true)

removeAllAssets(dispose)

Remove all assets

dispose - Defines whether the assets should also be disposed. (default true)

removeNamespaceAssets(ns, dispose)

Remove assets with namespace ns.

ns - An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets, string (default nil)

dispose - Defines whether the assets should also be disposed. (default true)


Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source