| Package | gs.managers |
| Class | public final class AssetManager |
Examples are in the guttershark repository.
See also
| Property | Defined by | ||
|---|---|---|---|
| lastLibraryName : String [static][read-only]
The last libraryName that was used to register an object.
| AssetManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
addAsset(libraryName:String, obj:String, source:* = null):void
[static]
Register an asset in the library.
| AssetManager | ||
|
dispose():void
[static]
Purge all assets from the library.
| AssetManager | ||
|
getAsset(libraryName:String):*
[static]
Get any stored asset.
| AssetManager | ||
|
getBitmap(libraryName:String, smooth:Boolean = true):Bitmap
[static]
Get a Bitmap.
| AssetManager | ||
|
getBitmapFromFZip(fzip:FZip, filename:String, receiver:Function, timeout:Number = 100):void
[static]
Send a bitmap from an fzip file to a receiver function.
| AssetManager | ||
|
getBitmapFromSWFLibrary(swfLibraryName:String, bitmapLinkageId:String, smooth:Boolean = true):Bitmap
[static]
Get a bitmap from a swf library.
| AssetManager | ||
|
getClass(exportName:String):Class
[static]
Get a Class.
| AssetManager | ||
|
getClassFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):Class
[static]
Get a class from a swf library.
| AssetManager | ||
|
[static]
Get an flv instance.
| AssetManager | ||
|
getFLVMetaData(libraryName:String):Object
[static]
Get an FLV's meta data.
| AssetManager | ||
|
getFLVXMPMetaData(libraryName:String):Object
[static]
Get an FLV's XMP meta data.
| AssetManager | ||
|
getFont(exportName:String):Font
[static]
Get a font.
| AssetManager | ||
|
getFontFromSWFLibrary(swfLibraryName:String, fontLinkageId:String):Font
[static]
Get a font from a swf library.
| AssetManager | ||
|
getFZip(libraryName:String):FZip
[static]
Get an FZip.
| AssetManager | ||
|
getJSON(libraryName:String):Object
[static]
Returns a JSON object that was loaded with a preloader.
| AssetManager | ||
|
getMovieClip(exportName:String):MovieClip
[static]
Get a movie clip.
| AssetManager | ||
|
getMovieClipFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):MovieClip
[static]
Get a movie clip from a swf library.
| AssetManager | ||
|
getNetStream(libraryName:String):NetStream
[static]
Get a loaded asset as a NetStream.
| AssetManager | ||
|
getSound(libraryName:String):Sound
[static]
Get a sound.
| AssetManager | ||
|
getSoundFromSWFLibrary(swfLibraryName:String, soundLinkageId:String):Sound
[static]
Get a sound from a swf library
| AssetManager | ||
|
getSprite(exportName:String):Sprite
[static]
Get a sprite.
| AssetManager | ||
|
getSpriteFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):Sprite
[static]
Get a sprite from a swf library.
| AssetManager | ||
|
getStyleSheet(libraryName:String):StyleSheet
[static]
Get a style sheet that was preloaded from a css file.
| AssetManager | ||
|
getSWF(libraryName:String):Loader
[static]
Get a loaded asset as a SWF.
| AssetManager | ||
|
getText(libraryName:String):String
[static]
Get an asset that was loaded as text.
| AssetManager | ||
|
getXML(libraryName:String):XML
[static]
Get a loaded asset as XML.
| AssetManager | ||
|
isAvailable(libraryName:String):Boolean
[static]
Check to see if an asset is available in the library.
| AssetManager | ||
|
isNetStreamLoaded(libraryName:String):Boolean
[static]
Check whether or not a net stream is 100% loaded.
| AssetManager | ||
|
removeAsset(libraryName:String):void
[static]
Remove an asset from the library.
| AssetManager | ||
|
saveFLVMetaData(libraryName:String, obj:*):void
[static]
Save an FLV's meta data.
| AssetManager | ||
|
saveFLVXMPMetaData(libraryName:String, obj:*):void
[static]
Save an FLV's XMP meta data.
| AssetManager | ||
| lastLibraryName | property |
lastLibraryName:String [read-only]The last libraryName that was used to register an object.
This is useful for when you don't neccessarily have a libraryName available, but you know that the librayName you need was the last asset registered in the AssetManager.
Implementation public static function get lastLibraryName():String
var am:AssetManager=AssetManager.gi(); addChild(am.getBitmap(am.lastLibraryName)); //assuming you know the last asset was a bitmap
| addAsset | () | method |
public static function addAsset(libraryName:String, obj:String, source:* = null):voidRegister an asset in the library.
ParameterslibraryName:String — The item id.
|
|
obj:String — The loaded asset object.
|
|
source:* (default = null) |
| dispose | () | method |
public static function dispose():voidPurge all assets from the library. The AssetManager is still usable after a dispose - just the assets are disposed of.
| getAsset | () | method |
public static function getAsset(libraryName:String):*Get any stored asset.
ParameterslibraryName:String — The library name used when the asset was registered.
|
* |
| getBitmap | () | method |
public static function getBitmap(libraryName:String, smooth:Boolean = true):BitmapGet a Bitmap.
This returns a bitmap in the current appliction domain. If preloading is loaded into the same application domain, it will get a bitmap from any swf.
ParameterslibraryName:String — The library name used when the asset was registered.
|
|
smooth:Boolean (default = true) |
Bitmap |
| getBitmapFromFZip | () | method |
public static function getBitmapFromFZip(fzip:FZip, filename:String, receiver:Function, timeout:Number = 100):voidSend a bitmap from an fzip file to a receiver function.
This method needs a reciever callback because the bitmap is loaded by calling "loader.loadBytes" which takes a few milliseconds. The bitmap will not be ready for you if this function returned immediately.
Parametersfzip:FZip — The FZip object.
|
|
filename:String — The filename inside the fzip.
|
|
receiver:Function — The receiver function: function(filename:String,bitmap:Bitmap).
|
|
timeout:Number (default = 100) — (Optional) The time to wait before triggering the callback in milliseconds.
|
function receiveBitmap(filename:String,bitmap:Bitmap):void{}
| getBitmapFromSWFLibrary | () | method |
public static function getBitmapFromSWFLibrary(swfLibraryName:String, bitmapLinkageId:String, smooth:Boolean = true):BitmapGet a bitmap from a swf library.
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
bitmapLinkageId:String — The bitmaps' linkage id.
|
|
smooth:Boolean (default = true) |
Bitmap |
| getClass | () | method |
public static function getClass(exportName:String):ClassGet a Class.
This returns a class in the current appliction domain. If preloading is loaded into the same application domain, it will get a class from any swf.
ParametersexportName:String — The item name in the library.
|
Class |
| getClassFromSWFLibrary | () | method |
public static function getClassFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):ClassGet a class from a swf library.
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
classNameInLibrary:String — The export class name in the loaded swf's library.
|
Class |
| getFLV | () | method |
public static function getFLV(libraryName:String):FLVGet an flv instance.
ParameterslibraryName:String — The library name used when the asset was registered.
|
FLV |
| getFLVMetaData | () | method |
public static function getFLVMetaData(libraryName:String):ObjectGet an FLV's meta data.
ParameterslibraryName:String — The library name used when registering the FLV.
|
Object |
| getFLVXMPMetaData | () | method |
public static function getFLVXMPMetaData(libraryName:String):ObjectGet an FLV's XMP meta data.
ParameterslibraryName:String — The library name used when registering the FLV.
|
Object |
| getFont | () | method |
public static function getFont(exportName:String):FontGet a font.
This returns a font in the current appliction domain. If preloading is loaded into the same application domain, it will get a font from any swf.
ParametersexportName:String — The export class name from the library.
|
Font |
| getFontFromSWFLibrary | () | method |
public static function getFontFromSWFLibrary(swfLibraryName:String, fontLinkageId:String):FontGet a font from a swf library.
The Font is also registered through Font.registerFont before it's returned.
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
fontLinkageId:String — The font linkage id.
|
Font |
| getFZip | () | method |
public static function getFZip(libraryName:String):FZipGet an FZip.
ParameterslibraryName:String — The library name used when the asset was registered.
|
FZip |
| getJSON | () | method |
public static function getJSON(libraryName:String):ObjectReturns a JSON object that was loaded with a preloader.
ParameterslibraryName:String — The library name used when the asset was registered.
|
Object |
| getMovieClip | () | method |
public static function getMovieClip(exportName:String):MovieClipGet a movie clip.
This returns a movie clip in the current appliction domain. If preloading is loaded into the same application domain, it will get a movie clip from any swf.
ParametersexportName:String — The export class name from the library.
|
MovieClip |
| getMovieClipFromSWFLibrary | () | method |
public static function getMovieClipFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):MovieClipGet a movie clip from a swf library.
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
classNameInLibrary:String — The export class name in the loaded swf's library.
|
MovieClip |
| getNetStream | () | method |
public static function getNetStream(libraryName:String):NetStreamGet a loaded asset as a NetStream.
ParameterslibraryName:String — The library name used when the asset was registered.
|
NetStream |
| getSound | () | method |
public static function getSound(libraryName:String):SoundGet a sound.
This returns a sound in the current appliction domain. If preloading is loaded into the same application domain, it will get a sound from any swf.
ParameterslibraryName:String — The library name used when the asset was registered.
|
Sound |
| getSoundFromSWFLibrary | () | method |
public static function getSoundFromSWFLibrary(swfLibraryName:String, soundLinkageId:String):SoundGet a sound from a swf library
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
soundLinkageId:String — The sounds' linkage id from the swf library.
|
Sound |
| getSprite | () | method |
public static function getSprite(exportName:String):SpriteGet a sprite.
This returns a sprite in the current appliction domain. If preloading is loaded into the same application domain, it will get a sprite from any swf.
ParametersexportName:String — The export class name from the library.
|
Sprite |
| getSpriteFromSWFLibrary | () | method |
public static function getSpriteFromSWFLibrary(swfLibraryName:String, classNameInLibrary:String):SpriteGet a sprite from a swf library.
ParametersswfLibraryName:String — The library name used when the swf asset was registered.
|
|
classNameInLibrary:String — The export class name in the loaded swf's library.
|
Sprite |
| getStyleSheet | () | method |
public static function getStyleSheet(libraryName:String):StyleSheetGet a style sheet that was preloaded from a css file.
ParameterslibraryName:String — The library name used when the asset was registered.
|
StyleSheet |
| getSWF | () | method |
public static function getSWF(libraryName:String):LoaderGet a loaded asset as a SWF.
The asset is cast as a Loader class
ParameterslibraryName:String — The library name used when the asset was registered.
|
Loader |
| getText | () | method |
public static function getText(libraryName:String):StringGet an asset that was loaded as text.
ParameterslibraryName:String — The library name used when the asset was registered.
|
String |
| getXML | () | method |
public static function getXML(libraryName:String):XMLGet a loaded asset as XML.
ParameterslibraryName:String — The library name used when the asset was registered.
|
XML |
| isAvailable | () | method |
public static function isAvailable(libraryName:String):BooleanCheck to see if an asset is available in the library.
ParameterslibraryName:String — The libraryName used to register the asset.
|
Boolean |
| isNetStreamLoaded | () | method |
public static function isNetStreamLoaded(libraryName:String):BooleanCheck whether or not a net stream is 100% loaded.
ParameterslibraryName:String — The library name used when the asset was registered.
|
Boolean |
| removeAsset | () | method |
public static function removeAsset(libraryName:String):voidRemove an asset from the library.
ParameterslibraryName:String — The asset's libraryName to remove.
|
| saveFLVMetaData | () | method |
public static function saveFLVMetaData(libraryName:String, obj:*):voidSave an FLV's meta data. You should use the same library name that the FLV was loaded with.
ParameterslibraryName:String — The library name used when the FLV was registered.
|
|
obj:* |
| saveFLVXMPMetaData | () | method |
public static function saveFLVXMPMetaData(libraryName:String, obj:*):voidSave an FLV's XMP meta data. You should use the same library name that the FLV was loaded with.
ParameterslibraryName:String — The library name used when the FLV was registered.
|
|
obj:* |