API Documentation for: 1.0.0
Show:

LoadTask Class

Extends Task
Defined in: LoadTask:11
Namespace: cloudkid

Load task is a common type of task used for loading assets through the MediaLoader

Constructor

LoadTask

(
  • id
  • url
  • callback
  • updateCallback
  • priority
  • data
)

Defined in LoadTask:11

Parameters:

  • id String

    Alias for the task

  • url String

    The url from which to load the asset

  • callback Function

    The function to call once loading is complete

  • updateCallback Function

    Optional call back to get load progress

  • priority Int

    Media loader priority of the load

  • data

    Opitonal loading options

Methods

cancel

() Bool

Inherited from Task but overwritten in cancel:107

Cancel the task - for use in inherited classes

Returns:

Bool:

If the loader removed it from the queue successfully - false means that there is a 'load finished' event inbound for the task manager

destroy

()

Inherited from Task but overwritten in destroy:131

Destroy this load task and don't use after this

done

(
  • result
  • manager
)

Inherited from Task: done:58

Called from the task manager when a Task is finished

Parameters:

  • result Type

    The resulting data from the return

  • manager TaskManager

    The reference to the manager

initialize

(
  • id
  • url
  • callback
  • updateCallback
  • priority
  • data
)

Inherited from Task but overwritten in initialize:67

Init the laod task

Parameters:

  • id String

    The id of the task

  • url String

    The url to load

  • callback Function

    The callback to call when the load is completed

  • updateCallback Function

    The optional callback to get updates (to show load progress)

  • priority Int

    The optional priority, defaults to normal

  • data

    The optional data object, for any loading options that may have been added to the preloader

start

(
  • callback
)

Inherited from Task but overwritten in start:90

Start the load

Parameters:

  • callback Function

    Callback to call when the load is done

ToString

() String

Defined in ToString:120

Get a string representation of this task

Returns:

String:

A string representation of this task

toString

() String

Inherited from Task: toString:93

Get a string representation of this task

Returns:

String:

A string representation of this task

Properties

_isDestroyed

Bool protected

Inherited from Task: _isDestroyed:37

Bool to keep track if this has been destroyed

callback

Function

Inherited from Task: callback:30

Callback to call when the task is completed

data

Defined in data:46

Loading options

id

String

Inherited from Task: id:23

The unique id of the task

priority

Int

Defined in priority:53

The media loader priorty of the load

updateCallback

Function

Defined in updateCallback:60

The optional callback to get updates (to show load progress)

url

String

Defined in url:39

The url of the file to load