Returns whether a specific asset exists
The ID or asset path for the asset
The asset type to match, or null to match any type
Whether the requested asset ID and type exists
Gets an instance of an embedded bitmap
The ID or asset path for the bitmap
(Optional) Whether to allow use of the asset cache (Default: true)
A new BitmapData object
Gets an instance of an embedded binary asset
The ID or asset path for the asset
A new ByteArray object
Gets an instance of an embedded font
The ID or asset path for the font
(Optional) Whether to allow use of the asset cache (Default: true)
A new Font object
Gets an instance of an included MovieClip
The ID for the MovieClip
A new MovieClip object
Gets the file path (if available) for an asset
The ID or asset path for the asset
The path to the asset, or null if it does not exist
Gets an instance of an embedded sound
The ID or asset path for the sound
(Optional) Whether to allow use of the asset cache (Default: true)
A new Sound object
Gets an instance of an embedded text asset
The ID or asset path for the asset
A new String object
Returns whether an asset is "local", and therefore can be loaded synchronously
The ID or asset path for the asset
The asset type to match, or null to match any type
(Optional) Whether to allow use of the asset cache (Default: true)
Whether the asset is local
Returns a list of all embedded assets (by type)
The asset type to match, or null to match any type
An array of asset ID values
Loads an included bitmap asset asynchronously
The ID or asset path for the asset
(Optional) Whether to allow use of the asset cache (Default: true)
Returns a Future
Load an included AssetLibrary
The name of the AssetLibrary to load
Returns a Future
Loads an included text asset asynchronously
The ID or asset path for the asset
Returns a Future
Registers a new AssetLibrary with the Assets class
The name (prefix) to use for the library
An AssetLibrary instance to register
Generated using TypeDoc
The Assets class provides a cross-platform interface to access embedded images, fonts, sounds and other resource files.
The contents are populated automatically when an application is compiled using the OpenFL command-line tools, based on the contents of the *.xml project file.
For most platforms, the assets are included in the same directory or package as the application, and the paths are handled automatically. For web content, the assets are preloaded before the start of the rest of the application. You can customize the preloader by extending the
in the project file.
NMEPreloader
class, and specifying a custom preloader using