LoomTextAsset
public class
loom.LoomTextAsset
Description
An asset loaded via Loom's asset system.
Loom's asset system supports live reload. LoomTextAsset is designed to make you write your code so that you automatically support live reload.
To use LoomTextAsset, do the following:
var myAsset = LoomTextAsset.create("assets/myasset.txt");
myAsset.updateDelegate += function(path:String, contents:String):void { trace("Loaded " + path + "!")};
myAsset.load();
The handler on updateDelegate will be called when the asset is loaded via load(), as well as any time the asset is updated via live reload.
API overview
Constructor
Attributes
Public attributes
| updateDelegate: LoomTextAssetUpdateDelegate |
native
Called when the asset is loaded, and any time it changes |
Constructor
LoomTextAsset ()
Attributes
updateDelegate: LoomTextAssetUpdateDelegate
native
Called when the asset is loaded, and any time it changes.
Parameters are a String containing the path and a String containing the contents of the file.
Functions
create ( path: String ): LoomTextAsset
static native
Create a new LoomTextAsset representing the requested path.
Parameters
| path: String |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
load (): Void
native
Initiate loading of the asset. Make sure to assign a callback to updateDelegate before you call this! Loading may not be synchronous.