Packagestencyl.api.engine
Classpublic dynamic class Script
InheritanceScript Inheritance Object
Subclasses ActorScript, SceneScript



Public Properties
 PropertyDefined By
  BACK : int = 2
[static]
Script
  FRONT : int = 0
[static]
Script
  GET_SCORES_URL : String = http://www.stencyl.com/v10/api/score/getTopEntries/
[static]
Script
  GET_SCORE_URL : String = http://www.stencyl.com/v10/api/score/getForCurrentPlayer/
[static]
Script
  lastCreatedActor : Actor = null
[static]
Script
  lastCreatedJoint : b2Joint = null
[static]
Script
  lastCreatedLabel : Label = null
[static]
Script
  lastCreatedPanel : Panel = null
[static]
Script
  lastCreatedRegion : Region = null
[static]
Script
  lastCreatedTerrainRegion : TerrainRegion = null
[static]
Script
  MIDDLE : int = 1
[static]
Script
  mpx : Number = 0
[static]
Script
  mpy : Number = 0
[static]
Script
  mrx : Number = 0
[static]
Script
  mry : Number = 0
[static]
Script
  scene : GameState
Script
  SUBMIT_SCORE_URL : String = http://www.stencyl.com/v10/api/score/submit/
[static]
Script
  wrapper : Behavior
Script
Public Methods
 MethodDefined By
  
Internal use only.
Script
  
abortTween(target:Object):void
[static]
Script
  
AddUnsigned(lX:*, lY:*):*
Script
  
adjustLocationForAllSounds(time:uint, volume:Number):void
Script
  
asBoolean(o:*):Boolean
[static] Accepts a literal boolean or String boolean.
Script
  
Script
  
Script
  
ConvertToWordArray(string:String):*
Script
  
createActor(type:ActorType, x:Number, y:Number, layerConst:int):Actor
Creates an actor of the given type at the given location and layer.
Script
  
createActorInNextScene(type:ActorType, x:Number, y:Number, layerConst:int):void
Creates an actor of the given type at the given location and layer when the next scene begins.
Script
  
createBoxRegion(x:int, y:int, w:int, h:int):Region
Create a rectangular Region
Script
  
createBoxTerrainRegion(x:int, y:int, w:int, h:int):TerrainRegion
Create a rectangular TerrainRegion
Script
  
createBrightnessFilter(b:Number):ColorMatrixFilter
[static]
Script
  
createCircularRegion(x:int, y:int, r:int):Region
Create a circular Region
Script
  
Create a circular TerrainRegion
Script
  
createFadeIn(duration:uint, color:uint = 0xff000000):Transition
Create a fade in transition for use in scene switching.
Script
  
createFadeOut(duration:uint, color:uint = 0xff000000):Transition
Create a fade out transition for use in scene switching.
Script
  
createGrayscaleFilter():ColorMatrixFilter
[static]
Script
  
createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null):b2RevoluteJoint
Script
  
createHueFilter(h:Number):ColorMatrixFilter
[static]
Script
  
createLabel(font:Font, text:String, x:int, y:int):Label
Script
  
createMultilineLabel(font:Font, text:String, x:int, y:int, w:int):Panel
Script
  
createNegativeFilter():ColorMatrixFilter
[static]
Script
  
createPanel(x:int, y:int, w:int, h:int):Panel
Script
  
createRecycledActor(type:ActorType, x:Number, y:Number, layerConst:int):Actor
Creates an actor of the given type at the given location and layer.
Script
  
createSaturationFilter(s:Number):ColorMatrixFilter
[static]
Script
  
createSepiaFilter():ColorMatrixFilter
[static]
Script
  
createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null):b2LineJoint
Script
  
createStickJoint(one:b2Body, two:b2Body, p1:V2 = null, p2:V2 = null):b2DistanceJoint
Script
  
createTintFilter(color:uint, amount:Number = 1):ColorMatrixFilter
[static]
Script
  
Script
  
destroyJointByID(jointID:int):void
Script
  
disableBehaviorForScene(behaviorName:String):void
Disable the given Behavior (by name) for the current scene
Script
  
Script
  
Script
  
Script
  
Disable the current Behavior.
Script
  
Call this if you need to do any drawing using draw()
Script
  
draw(g:Graphics, x:Number, y:Number):void
Script
  
enableBehaviorForScene(behaviorName:String):void
Enable the given Behavior (by name) for the current scene
Script
  
Script
  
Script
  
enableDebugDrawing(debugColor:uint = 0xff000000):void
Script
  
Script
  
Script
  
F(x:*, y:*, z:*):*
Script
  
fadeInForAllSounds(time:int):void
Script
  
fadeOutForAllSounds(time:int):void
Script
  
fadeTileLayerTo(layerID:uint, alphaPct:uint, duration:uint, easing:String = linear):void
Force the given layer to fade to the given opacity over time, applying the easing function.
Script
  
FF(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*
Script
  
format(message:String, ... args):void
Script
  
forwardMessage(msg:String):void
Internal use only.
Script
  
G(x:*, y:*, z:*):*
Script
  
getActor(actorID:Number):Actor
Script
  
getActorGroup(groupID:Number):FlxGroup
Script
  
getActorsAlongLine(x1:int, y1:int, x2:int, y2:int, callback:Function):void
Script
  
getActorsAtPoint(x:int, y:int, callback:Function):void
Script
  
getActorsInArea(x:int, y:int, w:int, h:int, callback:Function):void
Script
  
Returns an Array of Actors that intersect the Region
Script
  
Script
  
getActorsOnScreen(callback:Function):void
Script
  
getActorType(actorTypeID:uint):ActorType
Script
  
getActorTypeByName(typeName:String):ActorType
Script
  
Script
  
Get all Regions in a Scene
Script
  
Get all Regions in a Scene
Script
  
Script
  
Returns the actor that represents the camera
Script
  
Get the ID of the current scene.
Script
  
Get the name of the current scene.
Script
  
getFont(fontID:uint):Font
Script
  
getFPS():uint
Script
  
getGameAttribute(name:String):*
Script
  
Script
  
Script
  
getIDForResource(name:String):uint
Script
  
getIDForScene(sceneName:String):uint
Get the ID of a scene by name.
Script
  
Returns the 'default' image for the given actor type.
Script
  
getJoint(jointID:int):b2Joint
Script
  
Returns the last actor created in this scene.
Script
  
Script
  
Script
  
Script
  
Return the last created region
Script
  
Return the last created terrain region
Script
  
Script
  
Script
  
Script
  
Script
  
Script
  
Script
  
Script
  
getMouseX():Number
Script
  
getMouseY():Number
Script
  
getPlayerName():String
Script
  
getRegion(regionID:int):Region
Get a particular Region based on internal ID
Script
  
Script
  
Get the current scene.
Script
  
Get the height (in pixels) of the current scene.
Script
  
Get the width (in pixels) of the current scene.
Script
  
getScore(scoreName:String, callback:Function = null):void
Script
  
getScores(scoreName:String, numberToGrab:uint, callback:Function = null):void
Script
  
Script
  
Script
  
x-position of the camera
Script
  
y-position of the camera
Script
  
getSound(soundID:uint):SoundClip
Script
  
Script
  
getTerrainRegion(terrainRegionID:int):TerrainRegion
Get a particular Region based on internal ID
Script
  
getTileAt(row:int, col:int, layer:int):Tile
Returns the Tile at the specified row and column, or null if no tile is found nbsp;
Script
  
Get the height (in tiles) of the current scene.
Script
  
Get the width (in tiles) of the current scene.
Script
  
Script
  
getValueForScene(behaviorName:String, attributeName:String):Object
Script
  
GG(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*
Script
  
H(x:*, y:*, z:*):*
Script
  
Handle a collision with another Actor.
Script
  
HH(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*
Script
  
hideCursor():void
Script
  
hideFPS():void
Script
  
hideTileLayer(layerID:uint):void
Force the given layer to become invisible.
Script
  
I(x:*, y:*, z:*):*
Script
  
II(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*
Script
  
init():void
Called whenever this Actor or Scene is created.
Script
  
Script
  
isBehaviorEnabledForScene(behaviorName:String):Boolean
Check if the current scene contains the given Behavior (by name) and if said behavior is enabled.
Script
  
isCtrlDown():Boolean
Script
  
isGuest():Boolean
Script
  
isInRegion(a:Actor, r:Region):Boolean
Check whether the Actor intersects the Region
Script
  
isKeyDown(abstractKey:String):Boolean
Script
  
isKeyPressed(abstractKey:String):Boolean
Script
  
isKeyReleased(abstractKey:String):Boolean
Script
  
isMouseDown():Boolean
Script
  
isMousePressed():Boolean
Script
  
isMouseReleased():Boolean
Script
  
isShiftDown():Boolean
Script
  
isTransitioning():Boolean
Script
  
kongGetUserId():Number
Script
  
Script
  
kongIsGuest():Boolean
Script
  
kongSubmitStat(statName:String, value:Number):void
Script
  
Script
  
loadGame(fileName:String, callback:Function = null):void
Script
  
Script
  
MD5(string:String):String
Script
  
mute():void
Script
  
openURLInBrowser(URL:String):void
Script
  
pauseAll():void
Script
  
preWrap(text:String, maxWidth:int, font:Font):String
Script
  
print(message:*):void
Script
  
randomFloat():Number
Script
  
randomInt(low:int, high:int):Number
Script
  
Script
  
reloadCurrentScene(leave:Transition = null, enter:Transition = null):void
Reload the current scene, using an exit transition and then an enter transition.
Script
  
removeRegion(regionID:int):void
Remove a Region from a Scene
Script
  
removeTerrainRegion(terrainRegionID:int):void
Remove a Region from a Scene
Script
  
removeTileAt(row:int, col:int, layer:int):void
Remove a tile from a scene at runtime at the specified row and column.
Script
  
retrieveSaves(callback:Function = null):void
Script
  
RotateLeft(lValue:*, iShiftBits:*):*
MD5 (Message-Digest Algorithm) http://www.webtoolkit.info/
Script
  
runLater(delay:uint, toExecute:Function):void
Runs the given function after a delay.
Script
  
runPeriodically(interval:uint, toExecute:Function):void
Runs the given function periodically (every n seconds).
Script
  
sameAs(one:*, two:*):Boolean
[static] A generic way to compare two values or objects.
Script
  
saveGame(fileName:String, displayTitle:String, callback:Function = null):void
Script
  
sayToScene(behaviorName:String, msg:String, ... args):Object
Script
  
sceneHasBehavior(behaviorName:String):Boolean
Check if the current scene contains the given Behavior (by name)
Script
  
Script
  
Script
  
setCursor(graphic:Class = null, xOffset:int = 0, yOffset:int = 0):void
Script
  
setFPS(desiredFPS:uint):void
Script
  
setGameAttribute(name:String, value:*):void
Script
  
setGravity(x:Number, y:Number):void
Script
  
setLocationForAllSounds(location:Number):void
Script
  
setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void
Script
  
setScrollSpeedForBackground(xSpeed:Number, ySpeed:Number):void
Script
  
setTileAt(row:int, col:int, layer:int, tilesetID:int, tileID:int):void
Add a tile to the scene at runtime in the specified row and column
Script
  
setTimeScale(scale:Number):void
Script
  
setValueForScene(behaviorName:String, attributeName:String, value:Object):void
Script
  
setVolumeForAllSounds(volume:Number):void
Script
  
shoutToScene(msg:String, ... args):Object
Script
  
showCursor():void
Script
  
showTileLayer(layerID:uint):void
Force the given layer to show.
Script
  
simpleTweet(message:String, gameURL:String):void
Script
  
startFadeIn(color:uint = 0xffffffff, duration:Number = 1000, forceReset:Boolean = false):void
Script
  
startFadeOut(color:uint = 0xffffffff, duration:Number = 1000, forceReset:Boolean = false):void
Script
  
startShakingScreen(intensity:Number = 0.05, duration:Number = 500):void
Script
  
Script
  
stopFadeIn():void
Script
  
Script
  
Script
  
submitScore(scoreName:String, value:Number, callback:Function = null):void
Script
  
switchScene(sceneID:uint, leave:Transition = null, enter:Transition = null):void
Switch to the given scene, using an exit transition and then an enter transition.
Script
  
toPhysicalUnits(value:Number):Number
Script
  
toPixelUnits(value:Number):Number
Script
  
tween(attribute:Object = null, params:Object = null):Boolean
[static]
Script
  
tweenNumber(attributeName:String, toValue:Number, duration:Number, easing:String):Boolean
Script
  
unmute():void
Script
  
unpauseAll():void
Script
  
update():void
Called each time the game steps forward.
Script
  
Utf8Encode(string:String):String
Script
  
visitURL(URL:String, callback:Function = null):void
Script
  
WordToHex(lValue:*):*
Script
  
wordWrap(text:String, maxWidth:int, font:Font):Array
Script
Protected Methods
 MethodDefined By
  
Call this if you want to receive collision events for the actor.
Script
Property Detail
BACKproperty
public static var BACK:int = 2

FRONTproperty 
public static var FRONT:int = 0

GET_SCORE_URLproperty 
public static var GET_SCORE_URL:String = http://www.stencyl.com/v10/api/score/getForCurrentPlayer/

GET_SCORES_URLproperty 
public static var GET_SCORES_URL:String = http://www.stencyl.com/v10/api/score/getTopEntries/

lastCreatedActorproperty 
public static var lastCreatedActor:Actor = null

lastCreatedJointproperty 
public static var lastCreatedJoint:b2Joint = null

lastCreatedLabelproperty 
public static var lastCreatedLabel:Label = null

lastCreatedPanelproperty 
public static var lastCreatedPanel:Panel = null

lastCreatedRegionproperty 
public static var lastCreatedRegion:Region = null

lastCreatedTerrainRegionproperty 
public static var lastCreatedTerrainRegion:TerrainRegion = null

MIDDLEproperty 
public static var MIDDLE:int = 1

mpxproperty 
public static var mpx:Number = 0

mpyproperty 
public static var mpy:Number = 0

mrxproperty 
public static var mrx:Number = 0

mryproperty 
public static var mry:Number = 0

sceneproperty 
public var scene:GameState

SUBMIT_SCORE_URLproperty 
public static var SUBMIT_SCORE_URL:String = http://www.stencyl.com/v10/api/score/submit/

wrapperproperty 
public var wrapper:Behavior

Constructor Detail
Script()Constructor
public function Script(scene:GameState)

Internal use only.

Parameters
scene:GameState
Method Detail
abortTween()method
public static function abortTween(target:Object):void

Parameters

target:Object

AddUnsigned()method 
public function AddUnsigned(lX:*, lY:*):*

Parameters

lX:*
 
lY:*

Returns
*
adjustLocationForAllSounds()method 
public function adjustLocationForAllSounds(time:uint, volume:Number):void

Parameters

time:uint
 
volume:Number

asBoolean()method 
public static function asBoolean(o:*):Boolean

Accepts a literal boolean or String boolean.

Parameters

o:*

Returns
Boolean
bringRootPanelForward()method 
public function bringRootPanelForward():void

bringRootPanelToFront()method 
public function bringRootPanelToFront():void

ConvertToWordArray()method 
public function ConvertToWordArray(string:String):*

Parameters

string:String

Returns
*
createActor()method 
public function createActor(type:ActorType, x:Number, y:Number, layerConst:int):Actor

Creates an actor of the given type at the given location and layer.

Parameters

type:ActorType — the type of the Actor to create
 
x:Number — x-position of actor
 
y:Number — y-position of actor
 
layerConst:int — FRONT, MIDDLE or BACK

Returns
Actor — The created actor
createActorInNextScene()method 
public function createActorInNextScene(type:ActorType, x:Number, y:Number, layerConst:int):void

Creates an actor of the given type at the given location and layer when the next scene begins. You call this in the previous scene. Good for cases like entering doors and placing the main character at the right place.

Parameters

type:ActorType — the type of the Actor to create
 
x:Number — x-position of actor
 
y:Number — y-position of actor
 
layerConst:int — FRONT, MIDDLE or BACK

createBoxRegion()method 
public function createBoxRegion(x:int, y:int, w:int, h:int):Region

Create a rectangular Region

Parameters

x:int — x-position of the Region
 
y:int — y-position of the Region
 
w:int — width of the Region
 
h:int — height of the Region

Returns
Region — The newly created Region
createBoxTerrainRegion()method 
public function createBoxTerrainRegion(x:int, y:int, w:int, h:int):TerrainRegion

Create a rectangular TerrainRegion

Parameters

x:int — x-position of the TerrainRegion
 
y:int — y-position of the TerrainRegion
 
w:int — width of the TerrainRegion
 
h:int — height of the TerrainRegion

Returns
TerrainRegion — The newly created TerrainRegion
createBrightnessFilter()method 
public static function createBrightnessFilter(b:Number):ColorMatrixFilter

Parameters

b:Number

Returns
ColorMatrixFilter
createCircularRegion()method 
public function createCircularRegion(x:int, y:int, r:int):Region

Create a circular Region

Parameters

x:int — x-position of the Region
 
y:int — y-position of the Region
 
r:int — radius of the Region

Returns
Region — The newly created Region
createCircularTerrainRegion()method 
public function createCircularTerrainRegion(x:int, y:int, r:int):TerrainRegion

Create a circular TerrainRegion

Parameters

x:int — x-position of the TerrainRegion
 
y:int — y-position of the TerrainRegion
 
r:int — radius of the TerrainRegion

Returns
TerrainRegion — The newly created TerrainRegion
createFadeIn()method 
public function createFadeIn(duration:uint, color:uint = 0xff000000):Transition

Create a fade in transition for use in scene switching.

Parameters

duration:uint — how long the transition lasts (in milliseconds)
 
color:uint (default = 0xff000000) — color to fade in to. Default is black.

Returns
Transition — Fade in transition that you pass into reloadScene and switchScene
createFadeOut()method 
public function createFadeOut(duration:uint, color:uint = 0xff000000):Transition

Create a fade out transition for use in scene switching.

Parameters

duration:uint — how long the transition lasts (in milliseconds)
 
color:uint (default = 0xff000000) — color to fade out to. Default is black.

Returns
Transition — Fade out transition that you pass into reloadScene and switchScene
createGrayscaleFilter()method 
public static function createGrayscaleFilter():ColorMatrixFilter

Returns
ColorMatrixFilter
createHingeJoint()method 
public function createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null):b2RevoluteJoint

Parameters

one:b2Body
 
two:b2Body (default = null)
 
pt:V2 (default = null)

Returns
b2RevoluteJoint
createHueFilter()method 
public static function createHueFilter(h:Number):ColorMatrixFilter

Parameters

h:Number

Returns
ColorMatrixFilter
createLabel()method 
public function createLabel(font:Font, text:String, x:int, y:int):Label

Parameters

font:Font
 
text:String
 
x:int
 
y:int

Returns
Label
createMultilineLabel()method 
public function createMultilineLabel(font:Font, text:String, x:int, y:int, w:int):Panel

Parameters

font:Font
 
text:String
 
x:int
 
y:int
 
w:int

Returns
Panel
createNegativeFilter()method 
public static function createNegativeFilter():ColorMatrixFilter

Returns
ColorMatrixFilter
createPanel()method 
public function createPanel(x:int, y:int, w:int, h:int):Panel

Parameters

x:int
 
y:int
 
w:int
 
h:int

Returns
Panel
createRecycledActor()method 
public function createRecycledActor(type:ActorType, x:Number, y:Number, layerConst:int):Actor

Creates an actor of the given type at the given location and layer. It will attempt to use an unused instance of the actor type, or if none are available, it will create a new one instead.

Parameters

type:ActorType — the type of the Actor to create
 
x:Number — x-position of actor
 
y:Number — y-position of actor
 
layerConst:int — FRONT, MIDDLE or BACK

Returns
Actor — The created actor
createSaturationFilter()method 
public static function createSaturationFilter(s:Number):ColorMatrixFilter

Parameters

s:Number

Returns
ColorMatrixFilter
createSepiaFilter()method 
public static function createSepiaFilter():ColorMatrixFilter

Returns
ColorMatrixFilter
createSlidingJoint()method 
public function createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null):b2LineJoint

Parameters

one:b2Body
 
two:b2Body (default = null)
 
dir:V2 (default = null)

Returns
b2LineJoint
createStickJoint()method 
public function createStickJoint(one:b2Body, two:b2Body, p1:V2 = null, p2:V2 = null):b2DistanceJoint

Parameters

one:b2Body
 
two:b2Body
 
p1:V2 (default = null)
 
p2:V2 (default = null)

Returns
b2DistanceJoint
createTintFilter()method 
public static function createTintFilter(color:uint, amount:Number = 1):ColorMatrixFilter

Parameters

color:uint
 
amount:Number (default = 1)

Returns
ColorMatrixFilter
destroyJoint()method 
public function destroyJoint(j:b2Joint):void

Parameters

j:b2Joint

destroyJointByID()method 
public function destroyJointByID(jointID:int):void

Parameters

jointID:int

disableBehaviorForScene()method 
public function disableBehaviorForScene(behaviorName:String):void

Disable the given Behavior (by name) for the current scene

Parameters

behaviorName:String — The display name of the Behavior

disableCursor()method 
public function disableCursor():void

disableDebugDrawing()method 
public function disableDebugDrawing():void

disableGlobalSleeping()method 
public function disableGlobalSleeping():void

disableThisBehavior()method 
public function disableThisBehavior():void

Disable the current Behavior. The rest of this script will continue running, and cessation happens for any future run.

doesCustomDrawing()method 
public function doesCustomDrawing():void

Call this if you need to do any drawing using draw()

draw()method 
public function draw(g:Graphics, x:Number, y:Number):void

Parameters

g:Graphics
 
x:Number
 
y:Number

enableBehaviorForScene()method 
public function enableBehaviorForScene(behaviorName:String):void

Enable the given Behavior (by name) for the current scene

Parameters

behaviorName:String — The display name of the Behavior

enableContinuousCollisions()method 
public function enableContinuousCollisions():void

enableCursor()method 
public function enableCursor():void

enableDebugDrawing()method 
public function enableDebugDrawing(debugColor:uint = 0xff000000):void

Parameters

debugColor:uint (default = 0xff000000)

enableGlobalSleeping()method 
public function enableGlobalSleeping():void

enteredRegion()method 
public function enteredRegion(r:Region, a:Actor):void

Parameters

r:Region
 
a:Actor

F()method 
public function F(x:*, y:*, z:*):*

Parameters

x:*
 
y:*
 
z:*

Returns
*
fadeInForAllSounds()method 
public function fadeInForAllSounds(time:int):void

Parameters

time:int

fadeOutForAllSounds()method 
public function fadeOutForAllSounds(time:int):void

Parameters

time:int

fadeTileLayerTo()method 
public function fadeTileLayerTo(layerID:uint, alphaPct:uint, duration:uint, easing:String = linear):void

Force the given layer to fade to the given opacity over time, applying the easing function.

Parameters

layerID:uint — ID of the layer
 
alphaPct:uint — the opacity (0-255) to fade to
 
duration:uint — the duration of the fading (in milliseconds)
 
easing:String (default = linear) — easing function to apply. Linear (no smoothing) is the default.

FF()method 
public function FF(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*

Parameters

a:*
 
b:*
 
c:*
 
d:*
 
x:*
 
s:*
 
ac:*

Returns
*
format()method 
public function format(message:String, ... args):void

Parameters

message:String
 
... args

forwardMessage()method 
public function forwardMessage(msg:String):void

Internal use only.

Parameters

msg:String

G()method 
public function G(x:*, y:*, z:*):*

Parameters

x:*
 
y:*
 
z:*

Returns
*
getActor()method 
public function getActor(actorID:Number):Actor

Parameters

actorID:Number

Returns
Actor
getActorGroup()method 
public function getActorGroup(groupID:Number):FlxGroup

Parameters

groupID:Number

Returns
FlxGroup
getActorsAlongLine()method 
public function getActorsAlongLine(x1:int, y1:int, x2:int, y2:int, callback:Function):void

Parameters

x1:int
 
y1:int
 
x2:int
 
y2:int
 
callback:Function

getActorsAtPoint()method 
public function getActorsAtPoint(x:int, y:int, callback:Function):void

Parameters

x:int
 
y:int
 
callback:Function

getActorsInArea()method 
public function getActorsInArea(x:int, y:int, w:int, h:int, callback:Function):void

Parameters

x:int
 
y:int
 
w:int
 
h:int
 
callback:Function

getActorsInRegion()method 
public function getActorsInRegion(r:Region):Array

Returns an Array of Actors that intersect the Region

Parameters

r:Region — the Region

Returns
Array — An Array of Actors
getActorsOfType()method 
public function getActorsOfType(type:ActorType):HashSet

Parameters

type:ActorType

Returns
HashSet
getActorsOnScreen()method 
public function getActorsOnScreen(callback:Function):void

Parameters

callback:Function

getActorType()method 
public function getActorType(actorTypeID:uint):ActorType

Parameters

actorTypeID:uint

Returns
ActorType
getActorTypeByName()method 
public function getActorTypeByName(typeName:String):ActorType

Parameters

typeName:String

Returns
ActorType
getAllActorTypes()method 
public function getAllActorTypes():Array

Returns
Array
getAllRegions()method 
public function getAllRegions():Array

Get all Regions in a Scene

Returns
Array — An Array of all Regions in the Scene
getAllTerrainRegions()method 
public function getAllTerrainRegions():Array

Get all Regions in a Scene

Returns
Array — An Array of all Regions in the Scene
getBottomLayer()method 
public function getBottomLayer():int

Returns
int
getCamera()method 
public function getCamera():Actor

Returns the actor that represents the camera

Returns
Actor — The actor representing the camera
getCurrentScene()method 
public function getCurrentScene():uint

Get the ID of the current scene.

Returns
uint — The ID current scene
getCurrentSceneName()method 
public function getCurrentSceneName():String

Get the name of the current scene.

Returns
String — The name of the current scene
getFont()method 
public function getFont(fontID:uint):Font

Parameters

fontID:uint

Returns
Font
getFPS()method 
public function getFPS():uint

Returns
uint
getGameAttribute()method 
public function getGameAttribute(name:String):*

Parameters

name:String

Returns
*
getGravity()method 
public function getGravity():V2

Returns
V2
getGroundBody()method 
public function getGroundBody():b2Body

Returns
b2Body
getIDForResource()method 
public function getIDForResource(name:String):uint

Parameters

name:String

Returns
uint
getIDForScene()method 
public function getIDForScene(sceneName:String):uint

Get the ID of a scene by name.

Parameters

sceneName:String

Returns
uint — The ID current scene or 0 if it doesn't exist.
getImageForActorType()method 
public function getImageForActorType(type:ActorType):BitmapData

Returns the 'default' image for the given actor type.

Parameters

type:ActorType — the type of the Actor to create

Returns
BitmapData — The first frame for the default animation for the actor (or blank if none)
getJoint()method 
public function getJoint(jointID:int):b2Joint

Parameters

jointID:int

Returns
b2Joint
getLastCreatedActor()method 
public function getLastCreatedActor():Actor

Returns the last actor created in this scene. If the actor is dead, returns null.

Returns
Actor — The last created actor in this scene
getLastCreatedJoint()method 
public function getLastCreatedJoint():b2Joint

Returns
b2Joint
getLastCreatedLabel()method 
public function getLastCreatedLabel():Label

Returns
Label
getLastCreatedPanel()method 
public function getLastCreatedPanel():Panel

Returns
Panel
getLastCreatedRegion()method 
public function getLastCreatedRegion():Region

Return the last created region

Returns
Region — The last created Region
getLastCreatedTerrainRegion()method 
public function getLastCreatedTerrainRegion():TerrainRegion

Return the last created terrain region

Returns
TerrainRegion — The last created Terrain Region
getMiddleLayer()method 
public function getMiddleLayer():int

Returns
int
getMousePressedX()method 
public function getMousePressedX():Number

Returns
Number
getMousePressedY()method 
public function getMousePressedY():Number

Returns
Number
getMouseReleasedX()method 
public function getMouseReleasedX():Number

Returns
Number
getMouseReleasedY()method 
public function getMouseReleasedY():Number

Returns
Number
getMouseWorldX()method 
public function getMouseWorldX():Number

Returns
Number
getMouseWorldY()method 
public function getMouseWorldY():Number

Returns
Number
getMouseX()method 
public function getMouseX():Number

Returns
Number
getMouseY()method 
public function getMouseY():Number

Returns
Number
getPlayerName()method 
public function getPlayerName():String

Returns
String
getRegion()method 
public function getRegion(regionID:int):Region

Get a particular Region based on internal ID

Parameters

regionID:int — The internal ID of the Region you want to return

Returns
Region — A particular Region from the Scene
getRootPanel()method 
public function getRootPanel():Panel

Returns
Panel
getScene()method 
public function getScene():Scene

Get the current scene.

Returns
Scene — The current scene
getSceneHeight()method 
public function getSceneHeight():uint

Get the height (in pixels) of the current scene.

Returns
uint — height (in pixels) of the current scene
getSceneWidth()method 
public function getSceneWidth():uint

Get the width (in pixels) of the current scene.

Returns
uint — width (in pixels) of the current scene
getScore()method 
public function getScore(scoreName:String, callback:Function = null):void

Parameters

scoreName:String
 
callback:Function (default = null)

getScores()method 
public function getScores(scoreName:String, numberToGrab:uint, callback:Function = null):void

Parameters

scoreName:String
 
numberToGrab:uint
 
callback:Function (default = null)

getScreenHeight()method 
public function getScreenHeight():uint

Returns
uint
getScreenWidth()method 
public function getScreenWidth():uint

Returns
uint
getScreenX()method 
public function getScreenX():int

x-position of the camera

Returns
int — The x-position of the camera
getScreenY()method 
public function getScreenY():int

y-position of the camera

Returns
int — The y-position of the camera
getSound()method 
public function getSound(soundID:uint):SoundClip

Parameters

soundID:uint

Returns
SoundClip
getStepSize()method 
public function getStepSize():uint

Returns
uint
getTerrainRegion()method 
public function getTerrainRegion(terrainRegionID:int):TerrainRegion

Get a particular Region based on internal ID

Parameters

terrainRegionID:int — The internal ID of the Region you want to return

Returns
TerrainRegion — A particular Region from the Scene
getTileAt()method 
public function getTileAt(row:int, col:int, layer:int):Tile

Returns the Tile at the specified row and column, or null if no tile is found nbsp;

Parameters

row:int — Row within the scene
 
col:int — Column within the scene
 
layer:int — Layer order

Returns
Tile — Tile Tile at the specified location, or null
getTileHeight()method 
public function getTileHeight():uint

Get the height (in tiles) of the current scene.

Returns
uint — height (in tiles) of the current scene
getTileWidth()method 
public function getTileWidth():uint

Get the width (in tiles) of the current scene.

Returns
uint — width (in tiles) of the current scene
getTopLayer()method 
public function getTopLayer():int

Returns
int
getValueForScene()method 
public function getValueForScene(behaviorName:String, attributeName:String):Object

Parameters

behaviorName:String
 
attributeName:String

Returns
Object
GG()method 
public function GG(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*

Parameters

a:*
 
b:*
 
c:*
 
d:*
 
x:*
 
s:*
 
ac:*

Returns
*
H()method 
public function H(x:*, y:*, z:*):*

Parameters

x:*
 
y:*
 
z:*

Returns
*
handleCollision()method 
public function handleCollision(event:Collision):void

Handle a collision with another Actor. Automatically called by the engine. Must call registerCollisionHandler() for this to happen.

Parameters

event:Collision — Collision event

HH()method 
public function HH(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*

Parameters

a:*
 
b:*
 
c:*
 
d:*
 
x:*
 
s:*
 
ac:*

Returns
*
hideCursor()method 
public function hideCursor():void

hideFPS()method 
public function hideFPS():void

hideTileLayer()method 
public function hideTileLayer(layerID:uint):void

Force the given layer to become invisible.

Parameters

layerID:uint — ID of the layer

I()method 
public function I(x:*, y:*, z:*):*

Parameters

x:*
 
y:*
 
z:*

Returns
*
II()method 
public function II(a:*, b:*, c:*, d:*, x:*, s:*, ac:*):*

Parameters

a:*
 
b:*
 
c:*
 
d:*
 
x:*
 
s:*
 
ac:*

Returns
*
init()method 
public function init():void

Called whenever this Actor or Scene is created.

initKongregate()method 
public function initKongregate():void

isBehaviorEnabledForScene()method 
public function isBehaviorEnabledForScene(behaviorName:String):Boolean

Check if the current scene contains the given Behavior (by name) and if said behavior is enabled.

Parameters

behaviorName:String — The display name of the Behavior

Returns
Boolean — True if the scene contains the Behavior AND said behavior is enabled
isCtrlDown()method 
public function isCtrlDown():Boolean

Returns
Boolean
isGuest()method 
public function isGuest():Boolean

Returns
Boolean
isInRegion()method 
public function isInRegion(a:Actor, r:Region):Boolean

Check whether the Actor intersects the Region

Parameters

a:Actor — the Actor
 
r:Region — the Region

Returns
Boolean — True if the actor's bounds intersect the Region
isKeyDown()method 
public function isKeyDown(abstractKey:String):Boolean

Parameters

abstractKey:String

Returns
Boolean
isKeyPressed()method 
public function isKeyPressed(abstractKey:String):Boolean

Parameters

abstractKey:String

Returns
Boolean
isKeyReleased()method 
public function isKeyReleased(abstractKey:String):Boolean

Parameters

abstractKey:String

Returns
Boolean
isMouseDown()method 
public function isMouseDown():Boolean

Returns
Boolean
isMousePressed()method 
public function isMousePressed():Boolean

Returns
Boolean
isMouseReleased()method 
public function isMouseReleased():Boolean

Returns
Boolean
isShiftDown()method 
public function isShiftDown():Boolean

Returns
Boolean
isTransitioning()method 
public function isTransitioning():Boolean

Returns
Boolean
kongGetUserId()method 
public function kongGetUserId():Number

Returns
Number
kongGetUsername()method 
public function kongGetUsername():String

Returns
String
kongIsGuest()method 
public function kongIsGuest():Boolean

Returns
Boolean
kongSubmitStat()method 
public function kongSubmitStat(statName:String, value:Number):void

Parameters

statName:String
 
value:Number

leftRegion()method 
public function leftRegion(r:Region, a:Actor):void

Parameters

r:Region
 
a:Actor

loadGame()method 
public function loadGame(fileName:String, callback:Function = null):void

Parameters

fileName:String
 
callback:Function (default = null)

makeActorNotPassThroughTerrain()method 
public function makeActorNotPassThroughTerrain(actor:Actor):void

Parameters

actor:Actor

MD5()method 
public function MD5(string:String):String

Parameters

string:String

Returns
String
mute()method 
public function mute():void

openURLInBrowser()method 
public function openURLInBrowser(URL:String):void

Parameters

URL:String

pauseAll()method 
public function pauseAll():void

preWrap()method 
public function preWrap(text:String, maxWidth:int, font:Font):String

Parameters

text:String
 
maxWidth:int
 
font:Font

Returns
String
print()method 
public function print(message:*):void

Parameters

message:*

randomFloat()method 
public function randomFloat():Number

Returns
Number
randomInt()method 
public function randomInt(low:int, high:int):Number

Parameters

low:int
 
high:int

Returns
Number
recycleActor()method 
public function recycleActor(a:Actor):void

Parameters

a:Actor

registerCollisionHandler()method 
protected function registerCollisionHandler(a:Actor):void

Call this if you want to receive collision events for the actor.

Parameters

a:Actor — The actor whose collisions you want to receive

reloadCurrentScene()method 
public function reloadCurrentScene(leave:Transition = null, enter:Transition = null):void

Reload the current scene, using an exit transition and then an enter transition.

Parameters

leave:Transition (default = null) — exit transition
 
enter:Transition (default = null) — enter transition

removeRegion()method 
public function removeRegion(regionID:int):void

Remove a Region from a Scene

Parameters

regionID:int — The internal ID of the Region you want to remove

removeTerrainRegion()method 
public function removeTerrainRegion(terrainRegionID:int):void

Remove a Region from a Scene

Parameters

terrainRegionID:int — The internal ID of the Region you want to remove

removeTileAt()method 
public function removeTileAt(row:int, col:int, layer:int):void

Remove a tile from a scene at runtime at the specified row and column. Only removes tiles that were added at runtime.

Parameters

row:int — Row within the scene
 
col:int — Column within the scene
 
layer:int — Layer order

retrieveSaves()method 
public function retrieveSaves(callback:Function = null):void

Parameters

callback:Function (default = null)

RotateLeft()method 
public function RotateLeft(lValue:*, iShiftBits:*):*

MD5 (Message-Digest Algorithm) http://www.webtoolkit.info/

Parameters

lValue:*
 
iShiftBits:*

Returns
*
runLater()method 
public function runLater(delay:uint, toExecute:Function):void

Runs the given function after a delay.

Parameters

delay:uint — Delay in execution (in milliseconds)
 
toExecute:Function — The function to execute after the delay

runPeriodically()method 
public function runPeriodically(interval:uint, toExecute:Function):void

Runs the given function periodically (every n seconds).

Parameters

interval:uint — How frequently to execute (in milliseconds)
 
toExecute:Function — The function to execute after the delay

sameAs()method 
public static function sameAs(one:*, two:*):Boolean

A generic way to compare two values or objects. Used by the visual designer.

Parameters

one:*
 
two:*

Returns
Boolean
saveGame()method 
public function saveGame(fileName:String, displayTitle:String, callback:Function = null):void

Parameters

fileName:String
 
displayTitle:String
 
callback:Function (default = null)

sayToScene()method 
public function sayToScene(behaviorName:String, msg:String, ... args):Object

Parameters

behaviorName:String
 
msg:String
 
... args

Returns
Object
sceneHasBehavior()method 
public function sceneHasBehavior(behaviorName:String):Boolean

Check if the current scene contains the given Behavior (by name)

Parameters

behaviorName:String — The display name of the Behavior

Returns
Boolean — True if the scene contains the Behavior
sendRootPanelBack()method 
public function sendRootPanelBack():void

sendRootPanelToBack()method 
public function sendRootPanelToBack():void

setCursor()method 
public function setCursor(graphic:Class = null, xOffset:int = 0, yOffset:int = 0):void

Parameters

graphic:Class (default = null)
 
xOffset:int (default = 0)
 
yOffset:int (default = 0)

setFPS()method 
public function setFPS(desiredFPS:uint):void

Parameters

desiredFPS:uint

setGameAttribute()method 
public function setGameAttribute(name:String, value:*):void

Parameters

name:String
 
value:*

setGravity()method 
public function setGravity(x:Number, y:Number):void

Parameters

x:Number
 
y:Number

setLocationForAllSounds()method 
public function setLocationForAllSounds(location:Number):void

Parameters

location:Number

setOffscreenTolerance()method 
public function setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void

Parameters

top:int
 
left:int
 
bottom:int
 
right:int

setScrollSpeedForBackground()method 
public function setScrollSpeedForBackground(xSpeed:Number, ySpeed:Number):void

Parameters

xSpeed:Number
 
ySpeed:Number

setTileAt()method 
public function setTileAt(row:int, col:int, layer:int, tilesetID:int, tileID:int):void

Add a tile to the scene at runtime in the specified row and column

Parameters

row:int — Row to add the tile to
 
col:int — Column to add the tile to
 
layer:int — Layer order
 
tilesetID:int — ID of the Tileset to extract from
 
tileID:int — ID of the Tile from the Tileset

setTimeScale()method 
public function setTimeScale(scale:Number):void

Parameters

scale:Number

setValueForScene()method 
public function setValueForScene(behaviorName:String, attributeName:String, value:Object):void

Parameters

behaviorName:String
 
attributeName:String
 
value:Object

setVolumeForAllSounds()method 
public function setVolumeForAllSounds(volume:Number):void

Parameters

volume:Number

shoutToScene()method 
public function shoutToScene(msg:String, ... args):Object

Parameters

msg:String
 
... args

Returns
Object
showCursor()method 
public function showCursor():void

showTileLayer()method 
public function showTileLayer(layerID:uint):void

Force the given layer to show.

Parameters

layerID:uint — ID of the layer

simpleTweet()method 
public function simpleTweet(message:String, gameURL:String):void

Parameters

message:String
 
gameURL:String

startFadeIn()method 
public function startFadeIn(color:uint = 0xffffffff, duration:Number = 1000, forceReset:Boolean = false):void

Parameters

color:uint (default = 0xffffffff)
 
duration:Number (default = 1000)
 
forceReset:Boolean (default = false)

startFadeOut()method 
public function startFadeOut(color:uint = 0xffffffff, duration:Number = 1000, forceReset:Boolean = false):void

Parameters

color:uint (default = 0xffffffff)
 
duration:Number (default = 1000)
 
forceReset:Boolean (default = false)

startShakingScreen()method 
public function startShakingScreen(intensity:Number = 0.05, duration:Number = 500):void

Parameters

intensity:Number (default = 0.05)
 
duration:Number (default = 500)

stopAllSounds()method 
public function stopAllSounds():void

stopFadeIn()method 
public function stopFadeIn():void

stopFadeOut()method 
public function stopFadeOut():void

stopShakingScreen()method 
public function stopShakingScreen():void

submitScore()method 
public function submitScore(scoreName:String, value:Number, callback:Function = null):void

Parameters

scoreName:String
 
value:Number
 
callback:Function (default = null)

switchScene()method 
public function switchScene(sceneID:uint, leave:Transition = null, enter:Transition = null):void

Switch to the given scene, using an exit transition and then an enter transition.

Parameters

sceneID:uint — IT of the scene to switch to
 
leave:Transition (default = null) — exit transition
 
enter:Transition (default = null) — enter transition

toPhysicalUnits()method 
public function toPhysicalUnits(value:Number):Number

Parameters

value:Number

Returns
Number
toPixelUnits()method 
public function toPixelUnits(value:Number):Number

Parameters

value:Number

Returns
Number
tween()method 
public static function tween(attribute:Object = null, params:Object = null):Boolean

Parameters

attribute:Object (default = null)
 
params:Object (default = null)

Returns
Boolean
tweenNumber()method 
public function tweenNumber(attributeName:String, toValue:Number, duration:Number, easing:String):Boolean

Parameters

attributeName:String
 
toValue:Number
 
duration:Number
 
easing:String

Returns
Boolean
unmute()method 
public function unmute():void

unpauseAll()method 
public function unpauseAll():void

update()method 
public function update():void

Called each time the game steps forward. Automatically called by the engine.

Utf8Encode()method 
public function Utf8Encode(string:String):String

Parameters

string:String

Returns
String
visitURL()method 
public function visitURL(URL:String, callback:Function = null):void

Parameters

URL:String
 
callback:Function (default = null)

WordToHex()method 
public function WordToHex(lValue:*):*

Parameters

lValue:*

Returns
*
wordWrap()method 
public function wordWrap(text:String, maxWidth:int, font:Font):Array

Parameters

text:String
 
maxWidth:int
 
font:Font

Returns
Array