| Package | org.goasap |
| Class | public class PlayableBase |
| Inheritance | PlayableBase flash.events.EventDispatcher |
| Subclasses | GoItem, PlayableGroup, SequenceAdvance, SequenceBase |
[This section updated recently!]
PlayableBase extentes EventDispatcher and provides three general-purpose
properties:
state getter, found in the IPlayable interface.playableID value for each instance.
This property is a GoASAP convention that is not required by playable instances
but is used in utility functions like PlayableGroup.getChildByID()._playRetainer property that can by used to store
instances temporarily during play. This convention should be used with any
playable item that does not add itself to GoEngine (a Sequence instance for
example), to prevent garbage collection during play.Note: GoASAP's IPlayable structure was simplified at version 0.5.0 and now differs slightly from the information found in the Friends of Ed book, "The Essential Guide to Open Source Flash Development". Please regard the following changes:
state property was moved into the IPlayable interface, and the
playableID property is now treated as an optional convention.PLAYING, etc.) have been moved into
a new class called PlayStates.See also
| Property | Defined by | ||
|---|---|---|---|
| playableID : *
An arbitrary id value for the convenient identification of any
instance, automatically set to an instance count by this class.
| PlayableBase | ||
| state : String [read-only]
Returns a PlayStates constant.
| PlayableBase | ||
| Property | Defined by | ||
|---|---|---|---|
| _playRetainer : Dictionary [static]
Memory-management: playable items that do not add themselves to GoEngine should
use this property to store references to themselves during play.
| PlayableBase | ||
| Method | Defined by | ||
|---|---|---|---|
|
Throws an InstanceNotAllowedError if directly instantiated, also sets a
default playableID to an instance count number.
| PlayableBase | ||
|
toString():String
Appends the regular toString value with the instance's playableID.
| PlayableBase | ||
| playableID | property |
playableID:* [read-write]An arbitrary id value for the convenient identification of any instance, automatically set to an instance count by this class.
Implementation public function get playableID():*
public function set playableID(value:*):void
| _playRetainer | property |
protected static var _playRetainer:DictionaryMemory-management: playable items that do not add themselves to GoEngine should use this property to store references to themselves during play.
This prevents instance from getting garbage-collected during play. For an example, see SequenceBase's start and stop methods. This step is not necessary if GoEngine.addItem() is used by the item, since in that case GoEngine keeps a live reference during play.
This property is a convenience. You can mimic the technique using any static property, to temporarily protect the object from garbage collection.
See also
| state | property |
state:String [read-only]Returns a PlayStates constant.
Implementation public function get state():String
See also
| PlayableBase | () | constructor |
public function PlayableBase()Throws an InstanceNotAllowedError if directly instantiated, also sets a default playableID to an instance count number.
| toString | () | method |
public override function toString():StringAppends the regular toString value with the instance's playableID.
ReturnsString — String representation of this instance.
|