Packageorg.flixel.system.debug
Classpublic class VCR
InheritanceVCR Inheritance flash.display.Sprite

This class contains the record, stop, play, and step 1 frame buttons seen on the top edge of the debugger overlay.



Public Properties
 PropertyDefined By
  paused : Boolean
Whether the debugger has been paused.
VCR
  stepRequested : Boolean
Whether a "1 frame step forward" was requested.
VCR
Protected Properties
 PropertyDefined By
  _file : FileReference
VCR
  _flixel : Bitmap
VCR
  ImgFlixel : Class
VCR
  ImgOpen : Class
VCR
  ImgPause : Class
VCR
  ImgPlay : Class
VCR
  ImgRecordOff : Class
VCR
  ImgRecordOn : Class
VCR
  ImgRestart : Class
VCR
  ImgStep : Class
VCR
  ImgStop : Class
VCR
  _open : Bitmap
VCR
  _overOpen : Boolean
VCR
  _overPause : Boolean
VCR
  _overRecord : Boolean
VCR
  _overRestart : Boolean
VCR
  _overStep : Boolean
VCR
  _pause : Bitmap
VCR
  _play : Bitmap
VCR
  _pressingOpen : Boolean
VCR
  _pressingPause : Boolean
VCR
  _pressingRecord : Boolean
VCR
  _pressingRestart : Boolean
VCR
  _pressingStep : Boolean
VCR
  _recordOff : Bitmap
VCR
  _recordOn : Bitmap
VCR
  _restart : Bitmap
VCR
  _runtime : uint
VCR
  _runtimeDisplay : TextField
VCR
  _step : Bitmap
VCR
  _stop : Bitmap
VCR
Public Methods
 MethodDefined By
  
VCR()
Creates the "VCR" control panel for debugger pausing, stepping, and recording.
VCR
  
destroy():void
Clean up memory.
VCR
  
onOpen():void
Called when the "open file" button is pressed.
VCR
  
onPause():void
Called when the user presses the Pause button.
VCR
  
onPlay():void
Called when the user presses the Play button.
VCR
  
onRecord(StandardMode:Boolean = false):void
Called when the user presses the white record button.
VCR
  
onRestart(StandardMode:Boolean = false):void
Called when the user presses the Rewind-looking button.
VCR
  
onStep():void
Called when the user presses the fast-forward-looking button.
VCR
  
onStop():void
Called when the user presses the stop button.
VCR
  
playing():void
Usually called by FlxGame when a requested replay has begun.
VCR
  
recording():void
Usually called by FlxGame when a requested recording has begun.
VCR
  
stopped():void
Usually called by FlxGame when a replay has been stopped.
VCR
  
Called when the user presses the red record button.
VCR
  
updateRuntime(Time:uint):void
Just updates the VCR GUI so the runtime displays roughly the right thing.
VCR
Protected Methods
 MethodDefined By
  
checkOver():Boolean
This function checks to see what button the mouse is currently over.
VCR
  
init(E:Event = null):void
Just sets up basic mouse listeners, a la FlxWindow.
VCR
  
onMouseDown(E:MouseEvent = null):void
If the mouse is pressed down, check to see if the user started pressing down a specific button.
VCR
  
onMouseMove(E:MouseEvent = null):void
If the mouse moves, check to see if any buttons should be highlighted.
VCR
  
onMouseUp(E:MouseEvent = null):void
If the mouse is released, check to see if it was released over a button that was pressed.
VCR
  
onOpenCancel(E:Event = null):void
Called if the open file dialog is canceled.
VCR
  
onOpenComplete(E:Event = null):void
Called when a file is opened successfully.
VCR
  
onOpenError(E:Event = null):void
Called if there is a file open error.
VCR
  
onOpenSelect(E:Event = null):void
Called when a file is picked from the file dialog.
VCR
  
onSaveCancel(E:Event = null):void
Called when the save file dialog is cancelled.
VCR
  
onSaveComplete(E:Event = null):void
Called when the file is saved successfully.
VCR
  
onSaveError(E:Event = null):void
Called if there is an error while saving the gameplay recording.
VCR
  
unpress():void
Sets all the pressed state variables for the buttons to false.
VCR
  
updateGUI():void
Figures out what buttons to highlight based on the _overWhatever and _pressingWhatever variables.
VCR
Protected Constants
 ConstantDefined By
  DEFAULT_FILE_NAME : String = replay.fgr
[static]
VCR
  FILE_TYPES : Array
[static]
VCR
Property Detail
_fileproperty
protected var _file:FileReference

_flixelproperty 
protected var _flixel:Bitmap

_openproperty 
protected var _open:Bitmap

_overOpenproperty 
protected var _overOpen:Boolean

_overPauseproperty 
protected var _overPause:Boolean

_overRecordproperty 
protected var _overRecord:Boolean

_overRestartproperty 
protected var _overRestart:Boolean

_overStepproperty 
protected var _overStep:Boolean

_pauseproperty 
protected var _pause:Bitmap

_playproperty 
protected var _play:Bitmap

_pressingOpenproperty 
protected var _pressingOpen:Boolean

_pressingPauseproperty 
protected var _pressingPause:Boolean

_pressingRecordproperty 
protected var _pressingRecord:Boolean

_pressingRestartproperty 
protected var _pressingRestart:Boolean

_pressingStepproperty 
protected var _pressingStep:Boolean

_recordOffproperty 
protected var _recordOff:Bitmap

_recordOnproperty 
protected var _recordOn:Bitmap

_restartproperty 
protected var _restart:Bitmap

_runtimeproperty 
protected var _runtime:uint

_runtimeDisplayproperty 
protected var _runtimeDisplay:TextField

_stepproperty 
protected var _step:Bitmap

_stopproperty 
protected var _stop:Bitmap

ImgFlixelproperty 
protected var ImgFlixel:Class

ImgOpenproperty 
protected var ImgOpen:Class

ImgPauseproperty 
protected var ImgPause:Class

ImgPlayproperty 
protected var ImgPlay:Class

ImgRecordOffproperty 
protected var ImgRecordOff:Class

ImgRecordOnproperty 
protected var ImgRecordOn:Class

ImgRestartproperty 
protected var ImgRestart:Class

ImgStepproperty 
protected var ImgStep:Class

ImgStopproperty 
protected var ImgStop:Class

pausedproperty 
public var paused:Boolean

Whether the debugger has been paused.

stepRequestedproperty 
public var stepRequested:Boolean

Whether a "1 frame step forward" was requested.

Constructor Detail
VCR()Constructor
public function VCR()

Creates the "VCR" control panel for debugger pausing, stepping, and recording.

Method Detail
checkOver()method
protected function checkOver():Boolean

This function checks to see what button the mouse is currently over. Has some special behavior based on whether a recording is happening or not.

Returns
Boolean — Whether the mouse was over any buttons or not.
destroy()method 
public function destroy():void

Clean up memory.

init()method 
protected function init(E:Event = null):void

Just sets up basic mouse listeners, a la FlxWindow.

Parameters

E:Event (default = null) — Flash event.

onMouseDown()method 
protected function onMouseDown(E:MouseEvent = null):void

If the mouse is pressed down, check to see if the user started pressing down a specific button.

Parameters

E:MouseEvent (default = null) — Flash mouse event.

onMouseMove()method 
protected function onMouseMove(E:MouseEvent = null):void

If the mouse moves, check to see if any buttons should be highlighted.

Parameters

E:MouseEvent (default = null) — Flash mouse event.

onMouseUp()method 
protected function onMouseUp(E:MouseEvent = null):void

If the mouse is released, check to see if it was released over a button that was pressed. If it was, take the appropriate action based on button state and visibility.

Parameters

E:MouseEvent (default = null) — Flash mouse event.

onOpen()method 
public function onOpen():void

Called when the "open file" button is pressed. Opens the file dialog and registers event handlers for the file dialog.

onOpenCancel()method 
protected function onOpenCancel(E:Event = null):void

Called if the open file dialog is canceled.

Parameters

E:Event (default = null) — Flash Event.

onOpenComplete()method 
protected function onOpenComplete(E:Event = null):void

Called when a file is opened successfully. If there's stuff inside, then the contents are loaded into a new replay.

Parameters

E:Event (default = null) — Flash Event.

onOpenError()method 
protected function onOpenError(E:Event = null):void

Called if there is a file open error.

Parameters

E:Event (default = null) — Flash Event.

onOpenSelect()method 
protected function onOpenSelect(E:Event = null):void

Called when a file is picked from the file dialog. Attempts to load the file and registers file loading event handlers.

Parameters

E:Event (default = null) — Flash event.

onPause()method 
public function onPause():void

Called when the user presses the Pause button. This is different from user-defined pause behavior, or focus lost behavior. Does NOT pause music playback!!

onPlay()method 
public function onPlay():void

Called when the user presses the Play button. This is different from user-defined unpause behavior, or focus gained behavior.

onRecord()method 
public function onRecord(StandardMode:Boolean = false):void

Called when the user presses the white record button. If Alt is pressed, the current state is reset, and a new recording is requested. If Alt is NOT pressed, the game is reset, and a new recording is requested.

Parameters

StandardMode:Boolean (default = false) — Whether to reset the whole game, or just this FlxState. StandardMode == false is useful for recording demos or attract modes.

onRestart()method 
public function onRestart(StandardMode:Boolean = false):void

Called when the user presses the Rewind-looking button. If Alt is pressed, the entire game is reset. If Alt is NOT pressed, only the current state is reset. The GUI is updated accordingly.

Parameters

StandardMode:Boolean (default = false) — Whether to reset the current game (== true), or just the current state. Just resetting the current state can be very handy for debugging.

onSaveCancel()method 
protected function onSaveCancel(E:Event = null):void

Called when the save file dialog is cancelled.

Parameters

E:Event (default = null) — Flash Event.

onSaveComplete()method 
protected function onSaveComplete(E:Event = null):void

Called when the file is saved successfully.

Parameters

E:Event (default = null) — Flash Event.

onSaveError()method 
protected function onSaveError(E:Event = null):void

Called if there is an error while saving the gameplay recording.

Parameters

E:Event (default = null) — Flash Event.

onStep()method 
public function onStep():void

Called when the user presses the fast-forward-looking button. Requests a 1-frame step forward in the game loop.

onStop()method 
public function onStop():void

Called when the user presses the stop button. Stops the current replay.

playing()method 
public function playing():void

Usually called by FlxGame when a requested replay has begun. Just updates the VCR GUI so the buttons are in the right state.

recording()method 
public function recording():void

Usually called by FlxGame when a requested recording has begun. Just updates the VCR GUI so the buttons are in the right state.

stopped()method 
public function stopped():void

Usually called by FlxGame when a replay has been stopped. Just updates the VCR GUI so the buttons are in the right state.

stopRecording()method 
public function stopRecording():void

Called when the user presses the red record button. Stops the current recording, opens the save file dialog, and registers event handlers.

unpress()method 
protected function unpress():void

Sets all the pressed state variables for the buttons to false.

updateGUI()method 
protected function updateGUI():void

Figures out what buttons to highlight based on the _overWhatever and _pressingWhatever variables.

updateRuntime()method 
public function updateRuntime(Time:uint):void

Just updates the VCR GUI so the runtime displays roughly the right thing.

Parameters

Time:uint

Constant Detail
DEFAULT_FILE_NAMEConstant
protected static const DEFAULT_FILE_NAME:String = replay.fgr

FILE_TYPESConstant 
protected static const FILE_TYPES:Array