ControlConnection Class

Class com.blitzagency.xray.ControlConnection

Inheritance > ControlConnection

ControlConnection extends LocalConnection and is the lc primarily responsible for executing commands from the interface (IE: changing properties of a movieclip, controlling sound, video etc)
Constructor Summary
  
Property Summary
 Function 
 private MovieClip 
movieclip reference to the clip that currently is selected on stage with highlight.
 Function 
 DragableMovieClip 
Dragable (EECOLOR - Thanks to Erik Westra) enables a movieclip to be dragged around the stage.
 private Boolean 
focusEnabledCheck is a boolean property indicating whether or not a focusEabled was applied to an object onstage before we highlighted it.
 FPSMeter 
Instance of the FPSMeter object
 private Color 
Highlight color when a clip is selected in the treeview of the interface
 Boolean 
 ObjectViewer 
Instance of the ObjectViewer, which is what recurses the Flash app and returns XML formatted representation of your app.
 Number 
 Function 
 Array 
Array for pushing sections of the XML string returned by objViewer eg: it's a que
 private XML 
ObjectViewer returns an XML object that represents the physical layout of your app.
Method Summary
 Boolean 
 allowDomain(sendingDomain:String)
 Void 
 executeScript(sExecute:String)
executes commands (actionscript) from the interface. When you want change properties of a movieclip/object etc you have to execute commands at runtime that aren't in the compiled SWF
 Void 
 fpsOn(showFPS:Boolean)
fpsOn recieves a boolean and based on that, the FPSMeter is either turned on or off
 Void 
 getFunctionProperties(sObj:String)
getFunctionProperties was written to retrieve Class properties and methods. Since all Classes show up as type "Function" in the treeview and PI, I named it "getFunctionProperties"
 Void 
 getMovieClipProperties(sTarget_mc:String, bShowAll:Boolean)
returns all movieclip properties
 Void 
 getObjProperties(sObj:String, key:String)
returns the properties of an object
 Void 
 getSoundProperties(sSound:String)
retrieves the sound object's properties and returns them to the interface
 Void 
 getTipMovieClipProperties(sTarget_mc:String, bShowAll:Boolean)
returns via localConnection the tooltip properties. Hovering over a movieclip/button/textfield in the treeview will trigger the tooltip. The call is identical to getMovieClipProperties, except, the return is sent to a different method in the interface
 Void 
 getVideoProperties(sNetStream:String)
retrieves the NetStream object's properties and returns them to the interface
 Void 
This is a call recieved from the interface to turn the FPSMeter off. runFPS is a setter method.
 Void 
 highlightClip(sTarget_mc:String)
causes Flash's yellow selection rectangle to display around a movieclip
 Void 
 init()
 Boolean 
This is called by Xray when the component loads. It creates the listening connection
 Void 
 lowlightClip(sTarget_mc:String)
causes Flash's yellow selection rectangle to be removed
 Void 
 onStatus(infoObject:Object)
 Void 
 pauseVideo(sVideo:String)
pauses the NetStream object.
 Void 
 playSound(sSound:String, iLoops:Number)
plays the sound object specified. If loops is included, that is passed along as well
 Void 
 playVideo(sVideo:String, flv:String)
plays an FLV using the netStream object specified
 Void 
processes the que built by viewTree and sends the chunks of data via localConnection to the interface
 Void 
 sendFPS(obj:Object)
sends the current fps from the FPSMeter dispatch
 Void 
This is a call recieved from the interface to turn the FPSMeter on. runFPS is a setter method.
 Void 
 startExamineClips(sTarget_mc:String, iType:Number)
applies a color transform (yellow) to a clip on stage and causes it to be dragable
 Void 
 stopExamineClips(sTarget_mc:String, iType:Number)
restores the movieclip to original color transform and removes the dragable code from the object
 Void 
 stopSound(sSound:String)
stops the sound object specified.
 Void 
 stopVideo(sVideo:String)
stops the NetStream object specified.
 Void 
 updateHistory(target_mc:MovieClip)
Updates the change history object in the interface when an object is moved around on stage after making it dragable
 Void 
 viewTree(sTarget_mc:String, recursiveSearch:Boolean, showHidden:Boolean, objectSearch:Boolean)
called via the interface. This method calles ObjectViewer to recurse the application and return an XML formatted version of the applications structure.

You'll note that the XML is converted to a string and split into 5000 character chunks, then sent via LocalConnection to the interface. This is due to LC's speed limit of 40k. I'm not sure if it's 40k per movie frame or what, but I had throttle the que with an interval to pass the data.
 Void 
 writeChangeHistory(obj:Object)
writes out the change history in the IDE's output panel
Constructor Detail
ControlConnection
function ControlConnection()
Property Detail
addEventListener
public var addEventListener:Function;
boundingBox_mc
private var boundingBox_mc:MovieClip;
movieclip reference to the clip that currently is selected on stage with highlight. Used in resetting to original state when either selecting a new object or just deselecting the object althogether.
dispatchEvent
public var dispatchEvent:Function;
dragableMovieClip
public var dragableMovieClip:DragableMovieClip;
Dragable (EECOLOR - Thanks to Erik Westra) enables a movieclip to be dragged around the stage.
focusEnabledCheck
private var focusEnabledCheck:Boolean;
focusEnabledCheck is a boolean property indicating whether or not a focusEabled was applied to an object onstage before we highlighted it. When the object is deselected, we reset this property to its original value
fpsMeter
public var fpsMeter:FPSMeter;
Instance of the FPSMeter object
highlightColor
private var highlightColor:Color;
Highlight color when a clip is selected in the treeview of the interface
isConnected
public var isConnected:Boolean;
objViewer
public var objViewer:ObjectViewer;
Instance of the ObjectViewer, which is what recurses the Flash app and returns XML formatted representation of your app.
queSI
public var queSI:Number;
removeEventListener
public var removeEventListener:Function;
tree_que
public var tree_que:Array;
Array for pushing sections of the XML string returned by objViewer eg: it's a que
tree_xml
private var tree_xml:XML;
ObjectViewer returns an XML object that represents the physical layout of your app. This returned tree is assigned to tree_xml upon return.
Method Detail
allowDomain
public function allowDomain(sendingDomain:String):Boolean
executeScript
public function executeScript(sExecute:String):Void
Parameters:
sExecute:String
command to execute
Returns:
nothing
fpsOn
public function fpsOn(showFPS:Boolean):Void
Parameters:
showFPS:Boolean
true turns the FPSMeter on, false turns if off
Returns:
nothing
getFunctionProperties
public function getFunctionProperties(sObj:String):Void
Parameters:
sObj:String
full path to object
Returns:
nothing
getMovieClipProperties
public function getMovieClipProperties(sTarget_mc:String, bShowAll:Boolean):Void
Parameters:
sTarget_mc:String
string path to the movieclip
bShowAll:Boolean
use ASSetPropFlags to show all properties and methods
Returns:
nothing
getObjProperties
public function getObjProperties(sObj:String, key:String):Void
Parameters:
sObj:String
full path to the object
key:String
when an actual intrinsic "Object" is being sent, then a property is sent along (aka "key") - ie obj._x : "_x" would be the key
Returns:
nothing
getSoundProperties
public function getSoundProperties(sSound:String):Void
Parameters:
sSound:String
path to sound object
Returns:
nothing
getTipMovieClipProperties
public function getTipMovieClipProperties(sTarget_mc:String, bShowAll:Boolean):Void
Parameters:
sTarget_mc:String
string path to the movieclip
bShowAll:Boolean
use ASSetPropFlags to show all properties and methods
Returns:
nothing
getVideoProperties
public function getVideoProperties(sNetStream:String):Void
Parameters:
sNetStream:String
path to NetStream object
Returns:
nothing
hideFPS
public function hideFPS():Void
Returns:
nothing
highlightClip
public function highlightClip(sTarget_mc:String):Void
Parameters:
sTarget_mc:String
path to movieclip
Returns:
nothing
init
public function init():Void
initConnection
public function initConnection():Boolean
Returns:
Boolean false, and this means that another app is using the same localConnection name. True otherwise
lowlightClip
public function lowlightClip(sTarget_mc:String):Void
Parameters:
sTarget_mc:String
path to movieclip
Returns:
nothing
onStatus
public function onStatus(infoObject:Object):Void
pauseVideo
public function pauseVideo(sVideo:String):Void
Parameters:
sVideo:String
path to video object
Returns:
nothing
playSound
public function playSound(sSound:String, iLoops:Number):Void
Parameters:
sSound:String
path to sound object
iLoops:Number
number of loops to perform
Returns:
nothing
playVideo
public function playVideo(sVideo:String, flv:String):Void
Parameters:
sVideo:String
path to NetStream object
flv:String
relative url to the FLV file to play
Returns:
nothing
processQue
public function processQue():Void
Returns:
nothing
sendFPS
public function sendFPS(obj:Object):Void
Parameters:
obj:Object
Has one property: fps
Returns:
nothing
showFPS
public function showFPS():Void
Returns:
nothing
startExamineClips
public function startExamineClips(sTarget_mc:String, iType:Number):Void
Parameters:
sTarget_mc:String
path to movieclip
iType:Number
checking for a type of 2 (movieclip). Had thought that later, I could figure out a way to highlight other objects
Returns:
nothing
stopExamineClips
public function stopExamineClips(sTarget_mc:String, iType:Number):Void
Parameters:
sTarget_mc:String
path to movieclip
iType:Number
represents what type of object this is (2 = movieclip)
Returns:
nothing
stopSound
public function stopSound(sSound:String):Void
Parameters:
sSound:String
path to sound object
Returns:
nothing
stopVideo
public function stopVideo(sVideo:String):Void
Parameters:
sVideo:String
path to video object
Returns:
nothing
updateHistory
public function updateHistory(target_mc:MovieClip):Void
Parameters:
target_mc:MovieClip
movieclip reference
Returns:
nothing
viewTree
public function viewTree(sTarget_mc:String, recursiveSearch:Boolean, showHidden:Boolean, objectSearch:Boolean):Void
Parameters:
sTarget_mc:String
a string representing the path of the object to start at. IE: "_level0.main"
recursiveSearch:Boolean
a boolean indicating if ObjectViewer should recurse the application, or if they're using active treeview
showHidden:Boolean
showHidden let's ObjectViewer know whether or not to use ASSetPropFlags in the recursion

NOTE: ASSetPropFlags has a slight bug (don't know if it's fixed in 8Ball yet). Sometimes it leaves objects/properties un writable/undeletable after using ASSetPropFlags to show it. So, the user uses this feature at their own risk. 98% of the time it doesn't cause any bugs in the host.
Returns:
nothing
writeChangeHistory
public function writeChangeHistory(obj:Object):Void
Parameters:
obj:Object
object containes all of the change history from the interface
Returns:
nothing



Documentation generated by BLDoc Community Edition from B-Line Express.