Flash AS3 with TUIO - An Option?

I will have you know that I am beginning to capitulate on that decision to use Processing. Why was I going to use Processing? Because I thought it was the obvious choice to use with TUIO/Reactivision. And a few months ago while researching it, I turned away from using Flash AS3 because in the first para of that page it said Flash does not support TUIO/UDP and that made me very nervous. Very Nervous! What were all these confusing acronyms! I don't even code in AS3! What I read earlier also somehow gave me the impression that I'd have to use Processing to get the data, and if i wanted to use Flash, I'd have to make Processing talk to Flash on top of all the confusion! More confusion!

But, on rereading it yesterday on the advice of people more experienced with this than me, it seems like there is a way to use Flash/AS3 with TUIO. So, I had to investigate it, even though I don't know if I should be going so much into the technicalities.

UDP Flash-LocalConnection Bridging for TUIO/OSC Streams from Georg Kaindl on Vimeo.


What is UDP? UDP stands for User Datagram Protocol. Datagrams are like the little packets of information. UDP is quite simple is that it just transmits the datagrams without confirming or having to hand-shake the other side or anything, so it is good in cases where we don't mind losing a few packets along the way as opposed to making it all slow and laggy by having a two-way communication between the transmitter and the receiver.

How udp-flashlc-bridge works? it listens on the udp port and sends packets via flash Local Connection. so one could conceivably send TUIO tracking data to flash.

As I have no idea what I am doing (but it is important to learn how to do everything myself if I want to get anything done) I am going to take meticulous notes on everything as I try to figure it out. So please bear with me.

So as a simple test I downloaded udp-flashlc-bridge and ran it from Terminal.



Next, I ran tuiotest.swf while running reactivision and waving fidicual 1 in front of my camera, and flash DID receive the specific TUIOobject data. It also seemed very responsive.



What is TUIO? TUIO stands for Table-Top User Interfaces Objects and it is just a protocol for table-top tangible user interfaces. It was implemented using OpenSoundControl (OSC) so technically it is just a standardised way of presenting OSC information in a way that would be logical for use in TUIs.

in order to understand what all that frightful gobbledygook is about, i took a screenshot of the table on the TUIO page for easy reference. each packet which has the following attributes:

Picture 9


so you can interpret from the chart how i had taken the fidicual in and out of the camera range for about nine times by the time i had started running tuiotest.swf (based on sessionID increasing each time), and how i had moved it about (based on velocity and motion accelerator variables changing)...

in the course of trying to make the swf, i also learnt some things which will also reveal to anyone reading this blog how terrifyingly unfamiliar i am with AS3:

1. so i foolishly wrote a public class on the timeline
2. then it returned an error, saying public class must be within a package
3. then i put it inside a "package"
4. then it returned an error, saying the package was "nested"?
5. so i put the public class in a separate as file and used it as "include"
6. error persisted
7. then i used "import"
8. and then it worked

my layman's conjecture from this is that, apparently classes must be imported in with "import", upon which flash automatically puts them into a "package"? what i also understand is that up to this point i know very little about object oriented programming. goddam. i am trying to approach this like it's a manageable, reasonable thing i can figure out if i try hard enough.




USEFUL LINKS:
- Building your first multitouch app in as3

No Responses

Leave a Reply

Followers