Package | sekati.display |
Class | public class Canvas |
Inheritance | Canvas CoreSprite flash.display.Sprite |
Subclasses | Document |
Canvas
(sekati.display.Document
's superclass): exposes top-level, "global"
access to the stage
, root
, loaderInfo
& flashVar
for
all classes (including non-DisplayObject classes).
Developers implementing the API may find it handy to reference these objects via their static references:
Canvas.stage
Canvas.root
Canvas.loaderInfo
Canvas.flashVars
Note: Canvas
supports the loading of API implemented application in to other
SWF application or running "standalone". This is accomplished by calling setReferences()
in both the Canvas
constructor & in the ADDED_TO_STAGE
event handler of the subclassed
Document
Class. This prevents failure when being loaded in to another SWF's DisplayList
.
See also
Property | Defined by | ||
---|---|---|---|
enabled : BooleanBoolean stub property which subclasses implement to control core
behavor availability such as interactivity, liquidity, drag-drop functionality. | CoreSprite | ||
flashVars : Object [static]
Reference to the object that contains name-value pairs that represent the parameters
provided to the loaded SWF file through the
Object Embed Flashvars tags. | Canvas | ||
hasParent : Boolean [static]
Reference property which defines whether the
Canvas has a parent (and has thus been loaded by another
SWF): true or not (is executing under its own FlashPlayer instance): false . | Canvas | ||
interactiveMode : Boolean
Specifies the mouse cursors modal state in the object as an interactive
target via:
buttonMode, mouseChildren & tabChildren . | CoreSprite | ||
loaderInfo : LoaderInfo [static]
Reference to the
LoaderInfo object associated with the SWF file containing
information about loading the file to which this display object belongs. | Canvas | ||
root : DisplayObject [static]
Reference to the Application
root which represents the top-most display object, if this is the first
SWF file loaded (e.g. | Canvas | ||
scale : Number
The
scale value. | CoreSprite | ||
stage : Stage [static]
Reference to the Application
stage instance which represents the main drawing area. | Canvas |
Method | Defined by | ||
---|---|---|---|
Canvas()
Canvas Constructor
| Canvas | ||
addChildren(... args):void
Add multiple child
DisplayObject 's. | CoreSprite | ||
destroy():void
Clean up after thy self.
| CoreSprite | ||
toString():String
Return reflective output.
| CoreSprite |
Method | Defined by | ||
---|---|---|---|
invalidate():void
Request a redraw, use for deferred rendering.
| CoreSprite | ||
offStage(e:Event = null):void
Stub: Sprite has been removed from stage.
| CoreSprite | ||
onStage(e:Event = null):void
Stub: Sprite has been added to stage.
| CoreSprite | ||
setReferences():void
Initialize or update the core
DisplayList reference properties. | Canvas |
flashVars | property |
public static var flashVars:Object
Reference to the object that contains name-value pairs that represent the parameters
provided to the loaded SWF file through the Object Embed Flashvars
tags.
hasParent | property |
public static var hasParent:Boolean
Reference property which defines whether the Canvas
has a parent (and has thus been loaded by another
SWF): true
or not (is executing under its own FlashPlayer instance): false
.
loaderInfo | property |
public static var loaderInfo:LoaderInfo
Reference to the LoaderInfo
object associated with the SWF file containing
information about loading the file to which this display object belongs.
root | property |
public static var root:DisplayObject
Reference to the Application root
which represents the top-most display object, if this is the first
SWF file loaded (e.g. has not been loaded by another SWF), the root
property is the display
object itself. The root property of the Stage
object is the Stage
object itself.
stage | property |
public static var stage:Stage
Reference to the Application stage
instance which represents the main drawing area.
Canvas | () | constructor |
public function Canvas()
Canvas Constructor
setReferences | () | method |
protected function setReferences():void
Initialize or update the core DisplayList
reference properties.
This is externalized from the constructor so we may update the references when being loaded as an API application.
A check is made to see if the parent is an APILoader
instance:
if true
then the main API application is being loaded by a preloader
and the references are remapped to secure the top-level stage, root,
loaderInfo, flashVars
.