How to make flash application recognize/accept inputs from TUIO Simulator / Flosc
Posted: 14 May 2009 12:02 AM   [ Ignore ]
Rank
Joined  2009-03-15
Total Posts:  23
New Member

Hi guys,

Sorry I got a very newbie question. I just got the TUIO simulator 1.4 and I was able to use ito to run the demo flash applications (Multikey, Physics, Ripples). If I understand correctly, TUIO Simulator is used to simulate multitouch if you dont have the table. Flosc is the gateway that handles the UDP communication from the flash applications (I thought because it indicates if it receives UDP packets)

now my questions are:

1.) If I create a simple flash/flex application (released as swf), how can I use TUIO Simulator and Flosc Gateway to interact with it.?
2.) Is it something that I have to do with the actual flash application? How?
3.) Do I have to make it a flash exe application? Or swfs would work?

Sorry if I sound a bit puzzled coz I am… Coz If I will be able to figure out how to make my flash application interact with the simulator… then I can test it with my MT-mini.

My Flash application is just a simple canvass with a command button in the middle… thats It. I used Flexbuilder for it released as swf… I just want to make it work on multitouch first before I continue with more interfaces

pls help!

Thanks and more power again to NUI

Profile
 
 
Posted: 14 May 2009 04:34 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2009-03-15
Total Posts:  23
New Member

Ok…

I was able to figure it out somehow. Researched further and found the link for “Beginning your first multitouch application in flash”

http://wiki.nuigroup.com/Building_Your_First_Multi-Touch_Application_in_Flash

Tried the “Red Circle” example and I was able to make it work..

However I’m still kinda confused on how it worked. I mean I just followed the instructions.. thats it… But I really want to know how. Here’s the details of what I need to know:

1.) I figured that to be able to connect to flosc you will have to import TUIO references. However I got confused when I saw this code from the “Red Circle App”

import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;

.
. <!--some code here-->
.

//--------connect to TUIO-----------------
TUIO.init(this,’localhost’,3000,’’,true);
trace("MyTouchApp Initialized");
//----------------------------------------

For me Im not seeing imports to any TUIO references. So in short… Im confused on how this app connected to the flosc or even call the TUIO.init() command (coz i think this is not a resident as3 function)

2.) 2nd question is .. can I use flex builder for this… I have flex builder but I dont see any option to create a new Flash File. However I can create a new actionscript file

So I guess what Im trying to look for is an explanation to the code. Or just a simple explanation on how to connect a flash application to flosc

Apologies if my questions are pretty dumb. I’ve got zero knowledge in Flash and AS3...As you can see it took me 4-5 hours before I slightly figure out the answer to my first post. However I have some background in C# OOP so I got some clue on whats going on..

Im really excited to make my first flash application but I cannot get hyped if unless I know how to connect it to multitouch....

thanks again!

Profile
 
 
Posted: 14 May 2009 02:54 PM   [ Ignore ]   [ # 2 ]
Rank
Joined  2009-03-08
Total Posts:  11
New Member
joepen - 14 May 2009 04:34 AM

Ok…

I was able to figure it out somehow. Researched further and found the link for “Beginning your first multitouch application in flash”

http://wiki.nuigroup.com/Building_Your_First_Multi-Touch_Application_in_Flash

Tried the “Red Circle” example and I was able to make it work..

However I’m still kinda confused on how it worked. I mean I just followed the instructions.. thats it… But I really want to know how. Here’s the details of what I need to know:

1.) I figured that to be able to connect to flosc you will have to import TUIO references. However I got confused when I saw this code from the “Red Circle App”

import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;

.
. <!--some code here-->
.

//--------connect to TUIO-----------------
TUIO.init(this,’localhost’,3000,’’,true);
trace("MyTouchApp Initialized");
//----------------------------------------

For me Im not seeing imports to any TUIO references. So in short… Im confused on how this app connected to the flosc or even call the TUIO.init() command (coz i think this is not a resident as3 function)

2.) 2nd question is .. can I use flex builder for this… I have flex builder but I dont see any option to create a new Flash File. However I can create a new actionscript file

So I guess what Im trying to look for is an explanation to the code. Or just a simple explanation on how to connect a flash application to flosc

Apologies if my questions are pretty dumb. I’ve got zero knowledge in Flash and AS3...As you can see it took me 4-5 hours before I slightly figure out the answer to my first post. However I have some background in C# OOP so I got some clue on whats going on..

Im really excited to make my first flash application but I cannot get hyped if unless I know how to connect it to multitouch....

thanks again!

for your first question, if you go deep in the folders of touchlib`s SVN, you’ll see that the folder flash\events contains all the TUIO files. so when you use

import flash.events.*;

you have access to all TUIO methods, including the TUIO.init method which is used in the example.

for the second question, they actually want you to create a new project(document in flexbuilder) and select Flash File(ActionScript3).

flosc connects directly to the TUIO files so the TUIO.init and the touchevent handlers are pretty much all you need for a basic app ^^

Profile
 
 
Posted: 14 May 2009 10:28 PM   [ Ignore ]   [ # 3 ]
Rank
Joined  2009-03-15
Total Posts:  23
New Member

thanks for the info… I will let you know of my progress!

Profile
 
 
Posted: 14 May 2009 11:53 PM   [ Ignore ]   [ # 4 ]
Rank
Joined  2009-03-15
Total Posts:  23
New Member

cool… found it under

\int\flash\events

so basically is this folder is all I need to connect to flosc?

Is it required to have it on that directory format? Or is it movable in other folders

Profile