Integration doubts! (CCV 1.5 - AS3)
Posted: 27 May 2013 11:39 PM   [ Ignore ]
Avatar
Rank
Joined  2013-05-21
Total Posts:  9
New Member

Im Using CCV 1.5 And Adobe Flash CS6 (AS3), To simulate 3D rotation, Im doing this with mouse events,
and actually i want to use touch events, unfortunately i cant find a clear idea about how i can change mouse events for touch events

I also upload a .swf file to see the work of the code, i have seen Turbosquel As3TouchLib-master.

Actually i can play with de demos using ccv. I hope i can get some help. Thanks.

Here is the code:

import com.nuigroup.touch.TouchManager;
import com.nuigroup.touch.TouchOutput;
import com.nuigroup.touch.TouchProtocol;

TouchManager.initConnection(stage "192.168.1.5" 3333 TouchProtocol.CCVINPUT TouchOutput.TOUCH );
TouchManager.inputMode TouchProtocol.FLASHEVENT
TouchManager
.outputMode TouchOutput.TOUCH

casa
.stop();
miboton.addEventListener(MouseEvent.MOUSE_DOWN,rotations);
miboton.addEventListener(MouseEvent.MOUSE_DOWN,rotations);

var 
st=1;
function 
rotations(event:MouseEvent):void{
  
//trace("hola");
  
var iRotate 5;
  var 
initialFrame casa.currentFrame;
  var 
mousePosition =mouseX;
  
st=1;
  
addEventListener(Event.ENTER_FRAME,active);
    function 
active(event:Event{
        
var Xtraslate =mouseX-mousePosition;
        var 
FrameTraslate int(Xtraslate/iRotate);
        var 
finalFrame initialFrame-FrameTraslate;
        if (
finalFrame<1{
            finalFrame 
casa.totalFrames+finalFrame;
        
}
        
if (finalFrame>casa.totalFrames{
            finalFrame 
finalFrame-casa.totalFrames;
        
}
        
// voy al fotograma destino y produce la sensaciĆ³n de rotaciĆ³n.
        
if(st!=0)
            
casa.gotoAndStop(finalFrame);
    
}
}

miboton
.addEventListener(MouseEvent.ROLL_OUT,unactive);

function 
unactive(event:MouseEvent):void{
    st
=0;
}

Or Help me with this..

1. To connect CCV 1.5 with an AS3 App what lib should i use?

I’ve been following several ways to connect and finally i realice that i dont really understand the conecction.
I’m Using a - udp-flash-bridge.
Using turbosquel - AS3TouchLib-master(src,bin)
Using Gimmix - tuio_as3_v_0_8_asdoc(org)
- Flash Cs6 - As3

2. Why only Demos?
I can run the demos of the piano, fire, all of them, but when i try to make a touch app at myself looks like imposible..

3. Is there any recent guide to make this connections? all i’ve seen dates to 2009 - 2011 the packages have changes but the tutorials still are the same.

Thanks for you attention

File Attachments
casa3d.swf  (File Size: 426KB - Downloads: 251)
Profile
 
 
Posted: 28 May 2013 06:28 PM   [ Ignore ]   [ # 1 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

If you’re wanting native flash touch, read here:
http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffe.html

If you want touch from TUIO, you need to look up the touch events for that library and swap the mouse events for the touch events.

So if you’re using the TUIO AS3 Library(http://bubblebird.at/tuioflash/tuio-as3-library/), instead of MouseEvent.MOUSE_DOWN it would be something like TuioTouchEvent.TOUCH_DOWN. Then you have to adjust the corresponding functions to listen for event:TuioTouchEvent instead of event:MouseEvent.

Profile
 
 
Posted: 28 May 2013 07:25 PM   [ Ignore ]   [ # 2 ]
Avatar
Rank
Joined  2013-05-21
Total Posts:  9
New Member
HeroicNate - 28 May 2013 06:28 PM

If you’re wanting native flash touch, read here:
http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffe.html

If you want touch from TUIO, you need to look up the touch events for that library and swap the mouse events for the touch events.

So if you’re using the TUIO AS3 Library(http://bubblebird.at/tuioflash/tuio-as3-library/), instead of MouseEvent.MOUSE_DOWN it would be something like TuioTouchEvent.TOUCH_DOWN. Then you have to adjust the corresponding functions to listen for event:TuioTouchEvent instead of event:MouseEvent.

Thanks for your time and your reply!

Im using TuioAs3Lib, but im getting an starting problem

--
Escena 1, Layer ‘botones’, Frame 1, Line 3 1172: Definition org.tuio:TuioTouchEvent could not be found.
Escena 1, Layer ‘botones’, Frame 1, Line 4 1172: Definition org.tuio.connectors:UDPConnector could not be found.
Escena 1, Layer ‘botones’, Frame 1, Line 5 1172: Definition org.tuio:ITuioFiducialReceiver could not be found.
Escena 1, Layer ‘botones’, Frame 1, Line 6 1172: Definition org.tuio:TuioFiducialEvent could not be found.
--

When i add the touchevents listener, i dont get the last problem, but a got a new one.

miboton.addEventListener(MouseEvent.MOUSE_DOWN,rotations);
miboton.addEventListener(TuioTouchEvent.TOUCH_DOWNrotations);

var 
st=1;
function 
rotations(event:TuioTouchEvent):void{

New Problem

Escena 1, Layer ‘botones’, Frame 1, Line 45 1046: Type was not found or was not a compile-time constant: TuioTouchEvent.

Profile
 
 
Posted: 28 May 2013 07:41 PM   [ Ignore ]   [ # 3 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

you need to import the library to your project, like in my base example:
http://nuigroup.com/forums/viewthread/7364/P75/#72116

To use these libraries you need to have decent understanding of Actionscript 3. Are you familiar with AS3?

Profile
 
 
Posted: 28 May 2013 08:03 PM   [ Ignore ]   [ # 4 ]
Avatar
Rank
Joined  2013-05-21
Total Posts:  9
New Member

"Are you familiar with AS3? “

Omg! You make me open my dump eyes… i was using the wrong /org folder… i was using the Documentation (.html)… i dont know what happenend on my head.. i’ll correct it. and reply abput results omg! thanks!

Yes! Im Familiar with AS3 , just dind’t saw my giant fail.

THANKS!

Profile
 
 
Posted: 28 May 2013 09:14 PM   [ Ignore ]   [ # 5 ]
Avatar
Rank
Joined  2013-05-21
Total Posts:  9
New Member

Finally working, A LOT OF THANKS Nate! im running your base example with no errors directly with ccv!
Thanks for the time and help!

Now im working on my app, and i guess now it’s all about AS3 knowledge. Thanks!

Profile
 
 
Posted: 28 May 2013 10:29 PM   [ Ignore ]   [ # 6 ]
RankRank
Joined  2012-10-19
Total Posts:  148
Member

No problem. Glad you got it working smile

There are more features than just the base example, like Tap, which you can read through here: http://bubblebird.at/tuioflash/doc/
if you want more functions.

Profile
 
 
Posted: 29 May 2013 01:07 AM   [ Ignore ]   [ # 7 ]
Avatar
Rank
Joined  2013-05-21
Total Posts:  9
New Member

UPDATE: Alll Solved. smile

Profile
 
 
Posted: 15 July 2013 12:56 PM   [ Ignore ]   [ # 8 ]
Avatar
Rank
Joined  2013-02-08
Total Posts:  25
New Member

Hi Guirots,
I have same problem with you…
I try to launch the demo app from AS3TouchLib-master.
The demo work fine on my ftir project. I’m curious whether all of the demo use flash xml to communicate with ccv?
When I try debug this demo, the application can receive the blob if only I turn on the check box flash xml on CCV. When I try another check box (TUIO UDP) it’s not working.

I wanna make my own application like paint canvas....

Profile