AS3 Touch!Library Getting Started
Posted: 24 May 2008 06:37 PM   [ Ignore ]
Rank
Joined  2008-02-16
Total Posts:  81
New Member

I am getting more emails about the touch library I am using and let me say one thing, the library that the nuigroup is using through it’s SVN is far more advanced so if you want my advice, use that one. I created this library because I liked building it and it suits my needs at the moment. I didn’t wanted to release it because there might still be bugs in it and it’s not finished yet because I wanted to release it with a full documentation. But due to the emails I receive, I would like to release it anyway. I quickly made a tutorial on how to get started and to show how simple it is to build a multi-touch application.

1. Download FLOSC at http://benchun.net/flosc/
2. Download CCV: http://ccv.nuigroup.com/ or Touchlib: http://touchlib.com
3. Download Touch!Library (version 1) see attachment.
4. Look at the getting started video below.
5. Enjoy.

File Attachments
TouchLibraryv1.zip  (File Size: 24KB - Downloads: 1355)
 Signature 

Visit http://www.crystalminds.net/

Profile
 
 
Posted: 24 May 2008 08:04 PM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRankRank
Joined  2008-01-04
Total Posts:  676
Moderator

Very nice Mark, easy to follow and great for the beginner. wink I’m already up to Step.5!

 Signature 

Get Sparked at sparkon.net
ORION Multi-Touch Display (blog)
My YouTube

Profile
 
 
Posted: 24 May 2008 11:13 PM   [ Ignore ]   [ # 2 ]
Avatar
RankRankRankRank
Joined  2008-02-22
Total Posts:  556
Elite

Awesome Mark ! ! ! I’ll try it later. Nice video : )

 Signature 

http://www.justinriggio.com cool mad
http://www.niceminds.com My blog

Profile
 
 
Posted: 25 May 2008 12:37 PM   [ Ignore ]   [ # 3 ]
Avatar
RankRankRankRank
Joined  2008-02-22
Total Posts:  556
Elite

I set it up last night. Works good : ) Can you link the real video? youtube compresses it too much. Can’t really make out the code. I can get most of it but a beginner might not.

 Signature 

http://www.justinriggio.com cool mad
http://www.niceminds.com My blog

Profile
 
 
Posted: 25 May 2008 01:57 PM   [ Ignore ]   [ # 4 ]
Rank
Joined  2008-02-16
Total Posts:  81
New Member

I quickly made the video last night and removed it straight after it was uploaded to youtube :( To bad youtube is compressing so much, I already used a 800x600 resolution. Should have increased the fontsize as well. Anyway most of the things written in the video are also there in the Example.as so I hope people will know what to do if they read that.

Anyway I would like to add that it currently only supports the following commands:

TouchEvent.CONNECT
Dispatched when the connection to FLOSC succeeded or failed.

The object contains the following parameters.
- *success*:Boolean - the connection result: true if the connection succeeded; false if the connection failed.
- *error*:String - an error message if connection failed.

TouchEvent.CALIBRATION_COMPLETE
Dispatched when calibration is complete.

No parameters are available.

TouchEvent.FINGER_DOWN
Dispatched when a finger touches the object.

TouchEvent.FINGER_UP
Dispatched when a finger is released from the object.

TouchEvent.FINGER_MOVE
Dispatched when a finger moves over the object.

The object contains the following parameters.
- *id*:Number - a number indicating the finger id.
- *event*:String - a string containing the event name.
- *localX*:Number - a number indicating the screen x position, between 0 and 1.
- *localY*:Number - a number indicating the screen y position, between 0 and 1.
- *stageX*:Number - a number indicating the stage x position.
- *stageY*:Number - a number indicating the stage y position.
- *deltaX*:Number - a number indicating the delta x.
- *deltaY*:Number - a number indicating the delta y.
- *distance*:Number - a number indicating the distance from the delta x/y.
- *areaWidth*:Number - a number indicating the area width around the blob.
- *areaHeight*:Number - a number indicating the area height around the blob.

The Touch!Library has the following public functions:

/**
 * Function: connect
 * 
 * Establish a connection to the FLOSC.
 * 
 * Parameters:
 * host - the ip address of the FLOSC instance (default is localhost).
 * port - the port of the FLOSC instance (default is 3000).
 * 
 * Return:
 * Nothing. Causes the <TouchEvent.CONNECT> event to be fired in response.
 * 
 * Example:
 * (start code)
 * touchlib.connect("127.0.0.1", 3000)
 * (end)
 */    

/**
 * Function: disconnect
 * 
 * Closes the current connection to FLOSC.
 * 
 * Parameters:
 * None.
 * 
 * Return:
 * Nothing. 
 * 
 * Example:
 * (start code)
 * touchlib.disconnect()
 * (end)
 */    

/**
 * Function: blobsVisible
 * 
 * Shows (true) or hides (false) the drawn circles around the detected blobs.
 * 
 * Parameters:
 * visible - a boolean value determining whether or not to show the blobs.
 * 
 * Return:
 * Nothing.
 * 
 * Example:
 * (start code)
 * touchlib.blobsVisible(true)
 * (end)
 */    

/**
 * Function: calibration
 * 
 * Loads the calibration process to define the stage position on the screen.
 * 
 * Parameters:
 * None.
 * 
 * Return:
 * Nothing.
 * 
 * Example:
 * (start code)
 * touchlib.calibration()
 * (end)
 */    

/**
 * Function: startDrag
 *
 * Starts to drag the objecy.
 * 
 * Parameters:
 * fingerId - a number indicating the finger id.
 * sprite   - the sprite that needs to be dragged.
 * 
 * Return:
 * Nothing.
 * 
 * Example:
 * (start code)
 * touchlib.startDrag(12, mcExample)
 * (end)
 */    

/**
 * Function: stopDrag
 * 
 * Stops to drag the sprite.
 * 
 * Parameters:
 * fingerId - a number indicating the finger id that is dragging the sprite.
 * sprite   - the sprite that needs to be released (optional; if not given it will release all sprites by the finger id).
 * 
 * Return:
 * Nothing.
 * 
 * Example:
 * (start code)
 * touchlib.stopDrag(12, mcExample)
 * (end)
 */

 Signature 

Visit http://www.crystalminds.net/

Profile
 
 
Posted: 25 May 2008 05:34 PM   [ Ignore ]   [ # 5 ]
Avatar
RankRankRankRank
Joined  2008-02-22
Total Posts:  556
Elite

Thanks for the extra info.
About your video. It’s show me how things work together. That is important. Also this is the first time I used the simulator. So I have been playing around with it more. I don’t have to wast my projector hours testing. Thanks cool smile

 Signature 

http://www.justinriggio.com cool mad
http://www.niceminds.com My blog

Profile
 
 
Posted: 27 May 2008 10:45 PM   [ Ignore ]   [ # 6 ]
Avatar
RankRankRankRank
Joined  2008-02-22
Total Posts:  556
Elite

Here is my link to some added code to this wonderful project
http://niceminds.com/?cat=5
My download is called hotBlocks
check it out

 Signature 

http://www.justinriggio.com cool mad
http://www.niceminds.com My blog

Profile
 
 
Posted: 08 July 2008 03:24 PM   [ Ignore ]   [ # 7 ]
Avatar
Rank
Joined  2008-07-01
Total Posts:  54
New Member

Hey Mark,

I was looking around for a tutorial on how to get started making my own apps.Your TouchLibrary seemed to be the best suited for my knowledge, since i have little knowledge in coding for a multitouch environment. I am new to the multitouch app development and i was wondering if you could explain something to me.  I was wondering if you could do a video that explains how to use an anctionscript file from the SVN with your library. I was trying to use the RotatableScalable.as that i found in the TouchLib SVN. But i was having trouble trying to get some of the functions to work for me. I really just wanted to be able to make a rectangle the same way that you made the red square. But instead of being able to just drag it around. I was looking to use the RotatableScalable to be able to Rotate and Scale along with being able to drag. If you could just explain how this would be possible that would help me so much. Something like this video below:

I was also looking into using the Scrollable.as to be able to scroll through a list of objects. But i have to take it one step at a time. Thank you for your help in advance.

 Signature 

“Good ideas are only bad ideas that work!”

Profile
 
 
Posted: 11 July 2008 04:40 PM   [ Ignore ]   [ # 8 ]
Rank
Joined  2008-06-23
Total Posts:  24
New Member

1337Noobster, see yout other post.

Profile
 
 
Posted: 04 February 2009 02:41 PM   [ Ignore ]   [ # 9 ]
Avatar
Rank
Joined  2008-03-18
Total Posts:  76
New Member

would like to know the key differences between Mark’s Touchlibrary and Touchlib’s SVN AS3 library

 Signature 

http://anirudh.me

Profile
 
 
Posted: 18 December 2009 09:29 AM   [ Ignore ]   [ # 10 ]
Rank
Joined  2009-12-13
Total Posts:  3
New Member

I helped with. I do finish projects on multitoch using flsh as 3, please contact with my help.

Profile