PhidgetDictionary

EventDispatcher
PhidgetDictionary

A class for accessing the Phidget Dictionary.  See the programming manual for more specific API details, supported functionality, units, etc.

Summary
PhidgetDictionaryA class for accessing the Phidget Dictionary.
EventsEvents supported by all PhidgetDictionary.
Functions
openOpens a connection to a dictionary.
closecloses the connection to a dictionary.
addKeyAdds or changes a key/value pair to the dictionary.
removeKeyRemoves a (set) of key(s) that match the pattern.
Properties
AddressGets the server address.
PortGets the server port.

Events

Events supported by all PhidgetDictionary.  Pass these constants to the addEventListener() function when adding event listeners to a Phidget object.

PhidgetDictionaryEvent.CONNECTserver connect
PhidgetDictionaryEvent.DISCONNECTserver disconnect
PhidgetErrorEvent.ERRORasynchronous error

Functions

open

public function open(address: String,  
port: Number,  
password: String = null):void

Opens a connection to a dictionary.

Parameters

addressaddress of the webservice.  This can be ‘localhost’ when running from a single computer.
portport of the webservice.  This is 5001 by default.
passwordpassword of the webservice.  This is optional and doesn’t need to be specified for unsecured webservices.

close

public function close():void

closes the connection to a dictionary.

addKey

public function addKey(key: String,  
value: String,  
persistent: Boolean = true):void

Adds or changes a key/value pair to the dictionary.

Parameters

keykey value
valuevalue value
persistentoptional, default is true, determines whether a key remains after closing the connection to the dictionay

removeKey

public function removeKey(pattern: String):void

Removes a (set) of key(s) that match the pattern.  The pattern is a regular, or extended regular expression.

Parameters

patternpattern of keys to remove

Properties

Address

public function get Address():String

Gets the server address.

Port

public function get Port():int

Gets the server port.

public function open(address: String,  
port: Number,  
password: String = null):void
Opens a connection to a dictionary.
public function close():void
closes the connection to a dictionary.
public function addKey(key: String,  
value: String,  
persistent: Boolean = true):void
Adds or changes a key/value pair to the dictionary.
public function removeKey(pattern: String):void
Removes a (set) of key(s) that match the pattern.
public function get Address():String
Gets the server address.
public function get Port():int
Gets the server port.
Close