Thread |
Manages the execution of a single thread instance. This class should be managed by the ThreadManager.
__/ REQUIREMENTS \__
ActionScript 3.0 (or later)
__/ IMPORTS \__
nothing
__/ EXTENDS \__
com.bnm.api.CoreObject
__/ IMPLEMENTS \__
com.bnm.api.CoreInterface
__/ NOTICE \__
©opyright 2008 Bay New Media. All rights, as stipulated in the The MIT License, are reserved.
This ActionScript library is licensed and released under the MIT License (http://www.opensource.org
Please visit http://www.baynewmedia.com/ or email con@baynewm edia.com for information, questions, concerns, or bug reports. tact
__/ NOTES \__
This class is commented using the NaturalDocs documentation system. It is intended to be easily read both from the direct source code and from an adaptation that is generated as hyperlinked HTML. The NaturalDocs specification used in this class’ documentation is version 1.35 though older versions may probably be used safely. For more information, please visit: http://www.naturaldocs.org/
The BNMAPI is officially available (primary sources) on Source Forge (http://sourceforge.net/projects/bnmapi/), on the Bay New Media site (http;//www.baynewmedia.com/), on the PeaBee project site (http://www.peabee.com/), and through the Bay New Media SVM repository server (visit http://www.baynewmedia.com/ for more information). Downloads from other sources may not be complete or up-to-date.
If you’re interested in joining the BNMAPI project in any capacity (development, testing, distribution, etc.), please visit us on Source Forge or the Bay New Media web site.
Thread | Manages the execution of a single thread instance. |
Variables | |
_currentIteration | _currentIteration (uint): The current iteration counter of the thread. |
_enabled | _enabled (Boolean): Tracks whether or not the thread is enabled. |
_method | |
_context | |
_parameters | |
_iterations | |
_timeObject | |
Functions | |
Thread | Constructor method for the class. |
execute | Executes the thread instance, calling the targetted method with the specified parameters, and at the interval supplied. |
reset | Resets the current thread to its starting state. |
disable | Disables the thread from further execution. |
get status | Returns the status of the current Thread instance. |
Properties | |
status |
private var _currentIteration: uint
_currentIteration (uint): The current iteration counter of the thread. When this equals _iterations, the thread is disabled.
public function disable():void
Disables the thread from further execution. This can be reset by calling the reset method.
none
nothing
nothing
nothing
no
Returns the status of the current Thread instance. This can be used to check if parameters and other data were properly received by the class instance.
int: A value representing the class’ status. 0 means everything is okay and the thread is ready to execute. -1 means that crucial data is missing and the thread cannot execute. 1 means thread has hit its iteration limit and should either be reset or removed. Broadcasts: nothing
nothing
_currentIteration (uint): The current iteration counter of the thread.
private var _currentIteration: uint
_enabled (Boolean): Tracks whether or not the thread is enabled.
private var _enabled: Boolean
private var _method: Function
private var _context: *
private var _parameters: Array
private var _iterations: uint
private var _timeObject: TimeObject
Constructor method for the class.
public function Thread ( threadObj: Object )
Executes the thread instance, calling the targetted method with the specified parameters, and at the interval supplied.
public function execute():void
Resets the current thread to its starting state.
public function reset():void
Disables the thread from further execution.
public function disable():void
public function get status():int