Make Controller Kit

ActionScript 3.0 Documentation

OscMessage

com.makingthings.makecontroller.OscMessage

Classes:

Back to front page...

Last Updated: August 30, 2007

Summary

Constructor:

Properties:

1. address
2. args
3. from

Methods:


Class Information

For more information on OSC, check the OSC tutorial on makingthings.com.

For information on how to send out OscMessages, see the send(), sendToAddress(), sendMessage() or sendMessageToAddress() functions in the McFlashConnect section.

If you're sending multiple OscMessages to the board at once, consider grouping all the messages into an OscBundle and sending them out together. This reduces network traffic and improves performance.

An OscBundle is simply an Array that is full of OscMessages. Once you've created your OscMessages, stuff them into an Array and send them out using the the sendBundle() and sendBundleToAddress() functions in the McFlashConnect section.

Example

	// create an OscMessage that will set the state of LED 0 on the Application board to "on".
	var msg:OscMessage = new OscMessage( "/appled/0/state", [1] );
	
	// access the address using the . operator:
	var msgAddress:String = msg.address;
	
	// read (or write) data into the args array, also using the . operator:
	var data = msg.args[0]; // this will be 1
	
	// for incoming OscMessages, check to see where they came from:
	var msgFrom:String = msg.from;
	

See the list of all the OSC messages that the Make Controller knows how to respond to at http://www.makingthings.com/ref/firmware/html/group___o_s_c.html.


Constructor

OscMessage

function OscMessage( address:String, args:Array, from:String = "" )

Create a new OscMessage.

Parameters:

address:

The OSC address of this message

args:

An array of arguments. To specify no arguments, simply use []

from:

An optional string indicating where the message originated from. This is mostly used internally by McFlashConnect for incoming messages, and does not need to be set for outgoing messages.

Also see: (none)

Properties

address

public var address:String

The OSC address of the message. This must start with a /

Also see: (none)

args

public var args:Array

A list of zero or more arguments being sent to that OSC address. Arguments can be of type string, int, or float. If you have no arguments, simply provide an empty array by passing in []

Also see: (none)

from

public var from:String

For incoming OscMessages, this indicates which board it was sent from. For boards communicating via Ethernet, this will be an IP address. For USB boards, it will be some unique identifier - on Windows it will look like "COM9" and on OS X it will be a long, nasty device location string. This property is not relevant for outgoing OscMessages.

Also see: (none)

Methods

toString

public function toString( ):String

Return a string representing an OscMessage, with the arguments following the address, each separated by a space.

This will look like

 /address arg1 (arg2) (argN) 

Parameters:

(none)

Returns:

The OscMessage as a string, not including the from string.

Also see: (none)

The Make Controller Kit is an open source project maintained by MakingThings.
MakingThings code is released under the Apache 2.0 license.
Bug tracker, development wiki and status can be found at http://dev.makingthings.com.
Documentation produced with Zendoc.