Do you find that downloading and running that simple socket server annoying? Have you ever wished that you could just fire up the simulator and test your application.
Well now you can . . .
[end late night infomercial voice]
I added an optional local connection variable to the SimTouch application. This allows for the use of SimTouch without the need of a socket server or socket messaging of any kind. Just fire up application, resize and start testing. There is one drawback, your application has to be listening for the local connection.
Here is the code to add to the TUIO class:
(the TUIO class is located at flash.events.TUIO)
import the local connection class:
import flash.net.LocalConnection;
This block of code needs to be added to the TUIO init() function:
//---------------------------------------------------------------------------------------------------------------------------------------------
// Add Local Connection to the TUIO init method.
//---------------------------------------------------------------------------------------------------------------------------------------------
localConnection = new LocalConnection();
localConnection.client = TUIO;
localConnection.allowDomain('*');
localConnection.connect("_simulatedTouch");
This block of code handles the local connection event:
(you can add it anywhere but I added this right after the init() function or around line 116)
//---------------------------------------------------------------------------------------------------------------------------------------------
// Handle simulation event.
//---------------------------------------------------------------------------------------------------------------------------------------------
public static var localConnection:LocalConnection;
/**
* Handles the local connection event to the multi-touch applicaiton.
* Used in the SimTouch simulator.
* Calls the processMessage
*
* @param xml XML
*/
public static function simulatedTouchEventHandler(xml:XML):void
{
processMessage(xml)
}
There is also a checkbox to avoid getting that annoying warning box saying your not connected to port 3000.
Here is a bad screen shot of the settings panel with the new local checkbox:
Hope this helps,
MattL