1 of 2
1
Help Converting Existing Flash Program To Be Used With CCV
Posted: 11 January 2013 02:03 PM   [ Ignore ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

Firstly, thanks in advance to anyone who helps me out with this, I greatly appreciate it!

I already have a full application that I made in Flash that is kind-of a custom MS Paint, and is already using AS3’s MultiTouch library, but I need help converting it to accept touch events from CCV.

I’ve searched all over the forums, and it seems that my answer is in the Wiki which is down :( If anyone could help me I would greatly appreciate it!!

Also, I am compiling this into an Adobe Air program using Flash Builder when finished.

Thanks Again!!

John

Profile
 
 
Posted: 12 January 2013 12:41 AM   [ Ignore ]   [ # 1 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

I’d recommend using the touch drivers that converts tuio to windows touch events. Then you don’t need to adjust anything.

Profile
 
 
Posted: 12 January 2013 01:24 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

Yeah I’ve tried using the Multitouch Vista driver, but had the following issues with it:

1. Calibration was way off, even after trying all the recommended fixes here on the forum.
2. I’d like for it to be easy for other people to set-up. Multitouch Vista is too complicated for the average person to start-up and operate. By using just the Flash output in CCV you eliminate a lot of complication. CCV is rather easy for the average person to learn.

Is there an an easy way to implement the AS3 library or would I be required to rewrite all of the touch events?

Thanks!

Profile
 
 
Posted: 12 January 2013 01:26 AM   [ Ignore ]   [ # 3 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

I did my project with http://bubblebird.at/tuioflash/tuio-as3-library/

Once I got a handle on it it made sense, though I still don’t get how to set up gestures. General touch works a lot like standard flash touch using event listeners.

Profile
 
 
Posted: 22 January 2013 01:29 PM   [ Ignore ]   [ # 4 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

So how much code did you have to change to get it working with CCV? I don’t really care about implementing gestures, I just would like for multiple people to be able to draw at the same time.

Thanks!

Profile
 
 
Posted: 22 January 2013 01:40 PM   [ Ignore ]   [ # 5 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

Instead of using touchEvent, you use tuioTouchEvent. You just have to set up the code to listen to the UDP server. If I get spare time I’ll post a simple sample code that gets it working. There are posts in the forums about it and samples on his site if you can’t wait.

Profile
 
 
Posted: 22 January 2013 01:47 PM   [ Ignore ]   [ # 6 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

Thank you I appreciate it! So if my software is already written for MultiTouch AS3 (I’ve tested on a multitouch Sony computer and it works great) am I going to have to replace all of that code? Will the software still work on the touch screen?

I guess what I’m confused about is everytime there’s a MultiTouch event will I have to replace it with the tuioTouchEvent?

Thanks!

Profile
 
 
Posted: 22 January 2013 01:52 PM   [ Ignore ]   [ # 7 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

You’ll either have to replace them, or have both regular multi touch and tuio touch refer to the same separate function. I don’t know what kind of errors you may get if you use tuio on non tuio systems. I’ve never tried that.

Profile
 
 
Posted: 22 January 2013 01:54 PM   [ Ignore ]   [ # 8 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

So my best bet is to probably have two seperate versions, one for Touchscreens and one for IR it sounds like. I will post some of my code in a few minutes so you can see what I’m working with.

Profile
 
 
Posted: 22 January 2013 02:00 PM   [ Ignore ]   [ # 9 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

I don’t know really. It could be fine to have an all in one. I’ve just never tried. If you have the time it would be worth trying.

Profile
 
 
Posted: 22 January 2013 05:54 PM   [ Ignore ]   [ # 10 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

The only other thing I can think to do is combine MultiTouch vista with CCV so that people don’t get confused because I have to assume that anyone that uses it can’t figure it out. Do you know how I could compile all of these and the driver together for installation? I’ve never messed with that stuff before, just Flash and AS3.

What do you recommend?

Best,

John

Profile
 
 
Posted: 22 January 2013 09:14 PM   [ Ignore ]   [ # 11 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

Ok I started using BSQ Simulator and it’s awesome! However, how can I create an installer that installs MS .NET 4.5, MS Surface SDK, MS XNA 4.5, CCV, BSQ, and MS Visual C#?

It looks like the program “Advanced Installer” can do this, but I don’t know enough to do it. Basically I’d like to create an application that has the MS prerequisites, and installs an application that, when run, launches CCV and BSQ. Do you think this is possible? If so, I’m willing to donate to anyone that can help because I’m lost…

Thanks!

John

Profile
 
 
Posted: 23 January 2013 01:30 AM   [ Ignore ]   [ # 12 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

I have no idea about that last question. I don’t know much beyond some as3 as well. I would think it’d just be easier to put tuio events in your program as well and if no udp is detected have it stop listening for them or something. It might not have any bad effect to leave it in there even if there’s no tuio running.

It also may be fine to just leave your program as is and leave it up to the user to set up their own touch device.

Sample code to get tuio touch working:

import org.tuio.*;
import org.tuio.connectors.*;
import org.tuio.TuioTouchEvent;
import org.tuio.connectors.UDPConnector;
import org.tuio.TuioManager;
//---- Below is important for closing the program. More at the end ------
import flash.desktop.NativeApplication;
import flash.display.NativeWindow;
import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowType;
//-------------------------------------------------------------------------

var UDPCon:UDPConnector = new UDPConnector("127.0.0.1",3333);
var 
tc:TuioClient = new TuioClient(UDPCon);
var 
tm:TuioManager TuioManager.init(stage);
tc.addListener(tm);

stage.addEventListener(TuioTouchEvent.TOUCH_DOWNfingerDown);
stage.addEventListener(TuioTouchEvent.TOUCH_MOVEfingerMoved);
stage.addEventListener(TuioTouchEvent.TOUCH_UPfingerUp);

function 
fingerDown(event:TuioTouchEvent):void
{

}

function fingerMoved(event:TuioTouchEvent):void
{

}

function fingerUp(event:TuioTouchEvent):void
{
    
}

//--- For closing the program. If you don't call this then you will get crash errors after closing -----
stage.nativeWindow.addEventListener(Event.CLOSINGcloseApplicationfalse0true);

function 
closeApplication(e:Event):void
{
    UDPCon
.close();
}
//------------------------------------------------------------------------------------------------

I also updated a post with fiducial examples:
http://nuigroup.com/S=18849764a0e4aac425b5b0e1a272ef0d91f1b792/forums/viewthread/7364/P75/#72116

Profile
 
 
Posted: 24 January 2013 02:42 PM   [ Ignore ]   [ # 13 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

Thanks for this, it really helps! Would it be easier to use http://github.com/turbosqel/AS3TouchLib?

Thanks!

Profile
 
 
Posted: 24 January 2013 02:47 PM   [ Ignore ]   [ # 14 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

You’d have to make that decision for yourself. It depends on what you consider easier.

Profile
 
 
Posted: 24 January 2013 03:23 PM   [ Ignore ]   [ # 15 ]
Rank
Joined  2013-01-08
Total Posts:  15
New Member

I have another developer helping us out on this, but he doesn’t have any of the IR stuff set-up. What’s the best way for him to test? Or the best simulator I should say?

Thanks!

Profile
 
 
   
1 of 2
1