Options
Menu




AwayJS Core

Build Status

The root dependency for all AwayJS modules: contains basic data structures, loading mechanisms, event objects and utility functions useful for all types of rich media interface and interaction.

Documentation

Official AwayJS Documentation

Internal Structure

  • attributes
    Data structures for interleaved or isolated binary data streams.

  • audio
    Data structures for audio (to be moved to its own audio module).

  • errors
    Error types.

  • events
    Event objects for core classes.

  • geom
    Geometric data structures.

  • image
    Deprecated.

  • library
    Asset loading and management APIs.

  • managers
    Managers for audio (to be moved to own audio module).

  • net
    URL Request APIs.

  • parsers
    Base classes for parsers API, possibly merge with library.

  • projections
    Projection APIs for general 2D / 3D projection.

  • ui
    Helper classes for interface interaction.

  • utils
    Binary data wrappers, helper classes for RAF and timers, Color and debug utils.


version: @awayjs/core@0.6.87

Index

Events

LoaderInfo

LoaderInfo:

The LoaderInfo export class provides information about a loaded SWF file or a loaded image file(JPEG, GIF, or PNG). LoaderInfo objects are available for any display object. The information provided includes load progress, the URLs of the loader and loaded content, the number of bytes total for the media, and the nominal height and width of the media.

You can access LoaderInfo objects in two ways:

  • The contentLoaderInfo property of a flash.display.Loader object - The contentLoaderInfo property is always available for any Loader object. For a Loader object that has not called the load() or loadBytes() method, or that has not sufficiently loaded, attempting to access many of the properties of the contentLoaderInfo property throws an error.
  • The loaderInfo property of a display object.

The contentLoaderInfo property of a Loader object provides information about the content that the Loader object is loading, whereas the loaderInfo property of a DisplayObject provides information about the root SWF file for that display object.

When you use a Loader object to load a display object(such as a SWF file or a bitmap), the loaderInfo property of the display object is the same as the contentLoaderInfo property of the Loader object(DisplayObject.loaderInfo = Loader.contentLoaderInfo). Because the instance of the main export class of the SWF file has no Loader object, the loaderInfo property is the only way to access the LoaderInfo for the instance of the main export class of the SWF file.

The following diagram shows the different uses of the LoaderInfo object - for the instance of the main export class of the SWF file, for the contentLoaderInfo property of a Loader object, and for the loaderInfo property of a loaded object:

When a loading operation is not complete, some properties of the contentLoaderInfo property of a Loader object are not available. You can obtain some properties, such as bytesLoaded, bytesTotal, url, loaderURL, and applicationDomain. When the loaderInfo object dispatches the init event, you can access all properties of the loaderInfo object and the loaded image or SWF file.

Note: All properties of LoaderInfo objects are read-only.

The EventDispatcher.dispatchEvent() method is not applicable to LoaderInfo objects. If you call dispatchEvent() on a LoaderInfo object, an IllegalOperationError exception is thrown.

constructor

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function

    Returns void

dispatchEvent

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function

    Returns boolean

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function

    Returns void

bytes

  • The bytes associated with a LoaderInfo object.

    throws

    SecurityError If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content.

                      <p>For more information related to security, see the
                      Flash Player Developer Center Topic: <a
                      href="http://www.adobe.com/go/devnet_security_en"
                      scope="external">Security</a>.</p>
    

    Returns ByteArray

bytesLoaded

  • get (): number
  • The number of bytes that are loaded for the media. When this number equals the value of bytesTotal, all of the bytes are loaded.

    Returns number

bytesTotal

  • get (): number
  • The number of compressed bytes in the entire media file.

    Before the first progress event is dispatched by this LoaderInfo object's corresponding Loader object, bytesTotal is 0. After the first progress event from the Loader object, bytesTotal reflects the actual number of bytes to be downloaded.

    Returns number

content

  • The loaded object associated with this LoaderInfo object.

    throws

    SecurityError If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content.

                      <p>For more information related to security, see the
                      Flash Player Developer Center Topic: <a
                      href="http://www.adobe.com/go/devnet_security_en"
                      scope="external">Security</a>.</p>
    

    Returns AssetBase

contentType

  • get (): string
  • The MIME type of the loaded file. The value is null if not enough of the file has loaded in order to determine the type. The following list gives the possible values:

    • "application/x-shockwave-flash"
    • "image/jpeg"
    • "image/gif"
    • "image/png"

    Returns string

loader

  • The Loader object associated with this LoaderInfo object. If this LoaderInfo object is the loaderInfo property of the instance of the main export class of the SWF file, no Loader object is associated.

    throws

    SecurityError If the object accessing this API is prevented from accessing the Loader object because of security restrictions. This can occur, for instance, when a loaded SWF file attempts to access its loaderInfo.loader property and it is not granted security permission to access the loading SWF file.

                      <p>For more information related to security, see the
                      Flash Player Developer Center Topic: <a
                      href="http://www.adobe.com/go/devnet_security_en"
                      scope="external">Security</a>.</p>
    

    Returns Loader

url

  • get (): string
  • The URL of the media being loaded.

    Before the first progress event is dispatched by this LoaderInfo object's corresponding Loader object, the value of the url property might reflect only the initial URL specified in the call to the load() method of the Loader object. After the first progress event, the url property reflects the media's final URL, after any redirects and relative URLs are resolved.

    In some cases, the value of the url property is truncated; see the isURLInaccessible property for details.

    Returns string

Functions

getTimer

  • getTimer(): number
  • Returns number

Generated using TypeDoc