Class: FileAsset

FileAsset

FM.FileAsset

new FileAsset(pName, pPath)

The file asset represents a file object that can be used by the FM.js engine.
Parameters:
Name Type Description
pName string Name of the asset.
pPath string The path of the asset.
Author:
  • Simon Chauvin
Source:

Methods

getContent() → {string}

Get the content of the file.
Source:
Returns:
The content of the asset.
Type
string

getName() → {string}

Get the name of the file.
Source:
Returns:
The name of the asset.
Type
string

getPath() → {string}

Get the path to the file.
Source:
Returns:
The path of the asset.
Type
string

getRequest() → {XMLHttpRequest}

Get the HTML5 XMLHttpRequest object.
Source:
Returns:
The HTML5 object.
Type
XMLHttpRequest

isLoaded() → {boolean}

Check if this file has been loaded.
Source:
Returns:
Whether the asset is loaded.
Type
boolean

load()

Load the file.
Source:

setContent(pNewContent)

Set the content of the file.
Parameters:
Name Type Description
pNewContent string The new content of the file.
Source:

setLoaded()

Set the loaded boolean variable to true.
Source: