Tuio Flash Blog
17Sep/1125

Release v0.8

Well it really was about damn time. I finally managed to do an official release. Most of the stuff has already been lying around on svn for quite some time but every time I managed to find some time to work on the library I rather fixed bugs or rewrote some stuff than test and put together a new package <.<

Anyway, here is a short rundown of the changes in this release:

  • Merged Fiducial code into TuioManager
  • Streamlined Mouse and Windows7 dispatcher System -> TuioClient, MouseTuioAdapter, NativeTuioAdapter extending AbstractTuioAdapter
  • Renamed org.tuio.TouchEvent into org.tuio.TuioTouchEvent to solve naming conflicts
  • Improved gesture performance by utilizing object recycling
  • Added the new property "optional" to GestureSteps
  • Improved gestures especially zoom & rotate
  • Extended and updated documentation
  • Added gesture and fiducial examples to the library package
  • Improved usability of OSC classes for non internal means.
  • Added actual support for TUIO source messages
  • Fixed various bugs and hid some new ones ;)

As you can see the release contains quite some refactoring so I will update the HowTos accordingly in the next few days.

If you have any major problems migrating to the new release please let me know.

Comments (25) Trackbacks (0)
  1. done some work on a upper layer to your library just awaiting for reply on a submitted article to make it available on google code.
    After modifying it (between now and 2012 February) to make it work in this new version.
    If you wish the project name e-mail me and I will provide it, and if you find anything worth adding directly to the library I would be most interested in helping in that.
    I will also provide some working demos that can be modified to work as demos for tuio as3

  2. I’m getting this error when compiling

    /org/tuio/TuioFiducialEvent.as, Line 6 1172: Definition mx.controls:Button could not be found.

    I tried adding the flex sdk but it didn’t help…

    Any ideas?

    I’m using Flash CS5.5 on Mac.

  3. Well I don’t know how that error disappeared but now I’m getting this error…

    /org/tuio/connectors/udp/OSCDatagramSocket.as, Line 15 1017: The definition of base class DatagramSocket was not found.

  4. I changed the UDP connector to TCP and the mx.controls:Button error appeared again…

    This is frustrating…

  5. I’m getting the same error with Pier about DatagramSocket

    … \src\org\tuio\connectors\udp\OSCDatagramSocket.as(15): col: 41 Error: The definition of base class DatagramSocket was not found.

  6. @Pier: just remove the mx.controls import statement. I have no idea what that is doing in there …

    @Pier & Fathah: What tool do you use for your project? What is your Build target (Flash, AIR) and what version? THe UDPConnector will only work/compile in AIR projects targeted at version >= 2.0

  7. Thanks, after watching the code I commented it and it worked fine.

    I’m publishing in Flash IDE to flash player 10.2 so I changed the UDP connector to the LCConnector and again, success.

    Cheers!

  8. hi, i would like to run 2 visual application on my computer and send them tuio data from ccv. but if i am running flash with your library the port 3333 is occupied and i am not able to listen tuio data in another application (in quartz composer) is possible to resend tuio data to another tuio port in your library?.. or don’t you know if ccv allows me send tuio data to more ports in a same time? thank you in advance! best

  9. Using this version for a simple implementation, using UDPSocket under Air2.6. I’m generating TUIO events from another app that basically generates two swipes every 5 seconds, and rotates two objects continuously. The swipes are essentially continous touches that occur every 10ms across about 300 pixels…

    Here’s the issue:
    Things run fine for a while – but at random (sometimes within a minute, sometimes after an hour or two), it looks like the TUIO events are no longer heard anymore. Flash is still running fine, and I can still interact with other animations with mouse events that remain active.

    Trying to debug and wanted to know if this was a known bug or if this is new because of something I’m doing wrong. Current plans are to try to catch a disconnect event and report it to the stage to confirm that is the actual cause and then to simply implement a new “connect” if possible. Another option would be to disconnect then reconnect every minute or so. Final option would be to switch over to TCP instead of UDP. Thoughts?

  10. mh I haven’t stumbled upon this problem yet.
    Could you try to verify at which point of the message chain the touches get lost?
    e.g. by listening to TuioEvents or adding a custom ITuioListener to the TuioClient. You could also try adding a trace statement to the UDPConnector to check whether there are still incoming packets.
    UDP normally shouldn’t just loose connection since every sent packet is an independent transaction.
    Does restarting the tracker solve the problem or do you have to restart only the air app?

    Is the other app also done in flash? If yes you could try using the LCConnector.

  11. I have to restart the air app to recover.

    I am presently trying to restart the tracker via a keypress once it fails to see if I can get it to come back without restarting the air app…

    More to follow…

  12. The “other app” is not written in Flash. It’s an executable written in C that “spoofs” TUIO events that will eventually come from hardware…

  13. Hi,

    not sure if I’m missing something, but I don’t get how I can use mouse clicks instead of TUIO events for testing…
    I have to use import org.tuio.windows7.*;, but I have no folder windows7 under tuio…

    Cheers, Sonja

  14. Found something:
    http://code.google.com/p/tuio-as3/source/browse/trunk/org/tuio/windows7/Windows7TouchToTuioDispatcher.as?r=146

    But that’s uing a different version of TuioContainer (10 instead of 11 args, name is missing) and when I add that it’s not working anyway.. does anypone have a sample project?

  15. Mouse -> Tuio now works a little bit different since v0.8
    You have to use the org.tuio.adapter.MouseTuioAdapter class. It is used excatly like the TuioClient. So you create an instance of the MouseTuioAdapter and add your TuioManager as a listener via addListener.
    For NativeTouches -> Tuio it works in the same way by using org.tuio.adapter.NativeTuioAdapter
    I hope that helps. If not, please keep asking ;)

    PS: I have just checked and it looks like I haven’t updated the article on that topic in ages. I’ll do that asap, probably this weekend.

  16. I would honestly suggest that you split the MouseTuioAdapter into a Flash Player target version and then the adaptor to create an AIR target version. Under FDT, it simply does not compile with all the references to the AIR only libraries.

  17. Could you maybe post the compile error log so I can have a look at it? thx

  18. Sorry for the long delay in my answer, I didn’t see that you replied. Below is a tabs separated export of the problems view in FDT, simply copy it to a text file and open it with excel or google spreadsheets.

    Description Resource Path Location Type
    Wrong number of arguments. Expect maximal 11 but have found 14. Found at line 217 column 30. TuioManager.as /libs/tuio-as3-lib/src/org/tuio Unknown Flash Problem
    Wrong number of arguments. Expect maximal 11 but have found 14. Found at line 241 column 30. TuioManager.as /libs/tuio-as3-lib/src/org/tuio Unknown Flash Problem
    Wrong number of arguments. Expect maximal 11 but have found 14. Found at line 444 column 30. TuioManager.as /libs/tuio-as3-lib/src/org/tuio Unknown Flash Problem
    Could not resolve function ‘addItem’ at line 211 column 25. MouseTuioAdapter.as /libs/tuio-as3-lib/src/org/tuio/adapters Unknown Flash Problem
    Could not resolve function ‘display’ at line 225 column 24. MouseTuioAdapter.as /libs/tuio-as3-lib/src/org/tuio/adapters Unknown Flash Problem
    Variable ‘label’ is not declared. Found ‘label’ at line 235 column 60. MouseTuioAdapter.as /libs/tuio-as3-lib/src/org/tuio/adapters Unknown Flash Problem
    Wrong number of arguments. Default constructor doesn’t take any argument but there are 1. Found at line 210 column 35. MouseTuioAdapter.as /libs/tuio-as3-lib/src/org/tuio/adapters Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 53 column 20. UDPConnector.as /libs/tuio-as3-lib/src/org/tuio/connectors Unknown Flash Problem
    Could not resolve function ‘close’ at line 137 column 51. UDPConnector.as /libs/tuio-as3-lib/src/org/tuio/connectors Unknown Flash Problem
    Could not resolve function ‘send’ at line 128 column 51. UDPConnector.as /libs/tuio-as3-lib/src/org/tuio/connectors Unknown Flash Problem
    Variable ‘connected’ is not declared. Found ‘connected’ at line 128 column 24. UDPConnector.as /libs/tuio-as3-lib/src/org/tuio/connectors Unknown Flash Problem
    Variable ‘connected’ is not declared. Found ‘connected’ at line 137 column 24. UDPConnector.as /libs/tuio-as3-lib/src/org/tuio/connectors Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 30 column 10. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 31 column 10. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 32 column 10. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 33 column 10. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘addEventListener’ at line 34 column 10. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘bind’ at line 24 column 18. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘connect’ at line 25 column 14. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘dispatchEvent’ at line 38 column 12. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve function ‘receive’ at line 26 column 4. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve type reference to ‘DatagramSocket’ at line 15 column 41. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve type reference to ‘DatagramSocketDataEvent’ at line 37 column 39. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve type reference to ‘flash.events.DatagramSocketDataEvent’ at line 3 column 9. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Could not resolve type reference to ‘flash.net.DatagramSocket’ at line 7 column 9. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem
    Variable ‘DatagramSocketDataEvent’ is not declared. Found ‘DatagramSocketDataEvent’ at line 34 column 27. OSCDatagramSocket.as /libs/tuio-as3-lib/src/org/tuio/connectors/udp Unknown Flash Problem

  19. ok this makes things a bit clearer. First remove the UDPConnector from your source since that will only work in AIR and use the TCPConnector or LCConnector. That should remove most of the build errors.

    The first few errors in the TuioManager are very strange because they result from a different MouseEvent constructor than in the normal as3 api. Are you by any chance buidling against HaXe or Flash9?

    As for the build errors in the MouseTuioAdapter, they are a result of using the ContextMenu. You can simply comment thos lines and it should work.

    I will think about making an additional flash version of the library but in most cases you will use air for such projects anyway or simply have to remove some lines from the source to make it work.

  20. Yea I ended up removing those lines indeed. I also went through the code and here and there, there are some unused imports, I removed those too.

    As for a separate Flash version, now that the Flash Player has been updated with MouseEvent.RIGHT_CLICK it might not be necessary.

    I would not suggest to build your library only targeting AIR, because the alternative ways AS3 can be used in the future. For example, the software that my client built is a C++ compiled application that runs on Windows and it loads an SWF, there is no way to load an executable in their software. Scaleform also does that. I believe that Flash may evolve indeed as a self contained app (à la iOS or Android), but the SWF logic of being embedded into something may still happen in different forms, as Flash is good to build UI and afterwards interact with other processes. My two cents :)

  21. Hmm I stand corrected, there may be a need for a non AIR version after all, as the check for the target (AIR or SWF) is done at runtime, and not at compile time.

    Despite all my complaints, this is an awesome library, it helps greatly!

  22. You have a good point there for a non air version of the library. Actually splitting the code base won’t be an option because that will be a nightmare to maintain but I’ll see what I can do with compile-time constants and providing swc’s for the two targets.

    I”m glad to hear that the library is useful to you. If you happen to find any other stuff in the library that bugs you please let me know.

  23. Great work!!!

    Thanks for sharing.

    Guillermo

  24. About splitting the code, it wouldn’t be such a nightmare. For example, make it target SWF by default, and extend those classes for AIR and override the functions that need the difference.


Leave a comment


No trackbacks yet.