Make Controller Kit

ActionScript 3.0 Documentation

McEvent

com.makingthings.makecontroller.McEvent

Classes:

Back to front page...

Last Updated: August 30, 2007

Summary

Constructor:

Methods:


Class Information

An McEvent is an event that alerts you to some new Mchelper-related action. Register to hear about any of these events using the the addEventListener method.

Example

	var mcFlash:McFlashConnect = new McFlashConnect( );
	// set up our listeners
	mcFlash.addEventListener( McEvent.ON_CONNECT, onConnect );
	mcFlash.addEventListener( McEvent.ON_CONNECT_ERROR, onConnectError );
	mcFlash.addEventListener( McEvent.ON_CLOSE, onClose );
	mcFlash.addEventListener( McEvent.ON_MESSAGE_IN, onMessageIn );
	mcFlash.addEventListener( McEvent.ON_BOARD_ARRIVED, onBoardArrived );
	mcFlash.addEventListener( McEvent.ON_BOARD_REMOVED, onBoardRemoved );
	
	// and define the functions that will be listening
	function onMessageIn( event:McEvent )
	{
		var msg:OscMessage = event.data;
		trace( "new message: " + msg.toString() );
	}
	
	function onConnect( event:McEvent )
	{
		trace( "Mchelper connected successfully." );
	}
	
	function onConnectError( event:McEvent )
	{
		trace( "Couldn't connect to Mchelper." );
	}
	
	function onClose( event:McEvent )
	{
		trace( "The connection to Mchelper has closed." );
	}
	
	function onBoardArrived( event:McEvent )
	{
		var newBoard:Board == event.data;
		trace( "New board connected at " + newBoard.location );
	}
	
	function onBoardRemoved( event:McEvent )
	{
		var removedBoard:Board == event.data;
		trace( "Board removed at " + removedBoard.location );
	}
	

Constructor


Properties

ON_CONNECT

public static var ON_CONNECT:String

When your Flash movie has successfully made a connection to Mchelper, this event will be triggered.

The event's data property is empty.


Also see: (none)

ON_CONNECT_ERROR

public static var ON_CONNECT_ERROR:String

When your Flash movie cannot successfully make a connection to Mchelper, this event will be triggered.

The event's data property is empty.


Also see: (none)

ON_CLOSE

public static var ON_CLOSE:String

When the connection between your movie and Mchelper has been broken, this event will be triggered.

The event's data property is empty.


Also see: (none)

ON_MESSAGE_IN

public static var ON_MESSAGE_IN:String

This event will be triggered whenever there's a new message coming in from Mchelper to your Flash movie.

The event's data property will contain the OscMessage that has just arrived.


Also see: (none)

ON_BOARD_ARRIVED

public static var ON_BOARD_ARRIVED:String

This event will be triggered whenever a new board is connected to mchelper.

The event's data property will contain a Board object that indicates the board that has been connected.


Also see: (none)

ON_BOARD_REMOVED

public static var ON_BOARD_REMOVED:String

This event will be triggered whenever a board is disconnected.

The event's data property will contain a Board object that indicates the board that has been removed.


Also see: (none)

Methods


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.