2 of 3
2
Simple Flash Client? 
Posted: 24 July 2008 11:48 AM   [ Ignore ]   [ # 16 ]
Rank
Joined  2008-07-23
Total Posts:  23
New Member

no doesn’t make sence still the same error

Profile
 
 
Posted: 24 July 2008 11:55 AM   [ Ignore ]   [ # 17 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Can you post your EXACT code you are using?

Ivo - 24 July 2008 11:48 AM

no doesn’t make sence still the same error

Profile
 
 
Posted: 25 July 2008 03:01 AM   [ Ignore ]   [ # 18 ]
Rank
Joined  2008-07-23
Total Posts:  23
New Member

Only the one you gave me:

package app.demo.MyTouchApp{ //adds a circle where you touch (no resize)

    
import flash.display.*;        
    
import flash.events.*;
    
import flash.net.*;
    
import flash.geom.*;  
    
import app.core.action.RotatableScalable;      

    public class 
MyTouchApp extends RotatableScalable {

        
public function MyTouchApp() {

      

            addEventListener
(TouchEvent.MOUSE_DOWNtouchDown); //run touchdown, when touched
        
}
        
        
public function touchDown(e:TouchEvent):void{        
                        
            
var curPt:Point parent.globalToLocal(new Point(e.stageXe.stageY)); //convert touch points to x,y                
            
            
var circle:Sprite = new Sprite(); //create a new sprite
            
            
circle.graphics.lineStyle(500xff0000); //set line width to 10px and red
            
circle.graphics.drawCircle(0,0,40); // draw a 40px circle
            
circle.curPt.x//put it where touch is (x cord)
            
circle.curPt.y//put it where touch is (y cord)

            
addChild(circle); //add the circle where touch happened
            
        
}
    }
}

Profile
 
 
Posted: 25 July 2008 05:09 AM   [ Ignore ]   [ # 19 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

I posted this.
It is different.

package app.demo.MyTouchApp{ //adds a circle where you touch (no resize)

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

    public class 
MyTouchApp extends Sprite {

        
public function MyTouchApp() {

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

            
addEventListener(TouchEvent.MOUSE_DOWNtouchDown); //run touchdown, when touched
        
}
        
        
public function touchDown(e:TouchEvent):void{        
                        
            
var curPt:Point parent.globalToLocal(new Point(e.stageXe.stageY)); //convert touch points to x,y                
            
            
var circle:Sprite = new Sprite(); //create a new sprite
            
            
circle.graphics.lineStyle(100xff0000); //set line width to 10px and red
            
circle.graphics.drawCircle(0,0,40); // draw a 40px circle
            
circle.curPt.x//put it where touch is (x cord)
            
circle.curPt.y//put it where touch is (y cord)

            
addChild(circle); //add the circle where touch happened
            
        
}
    }
}

Profile
 
 
Posted: 26 July 2008 10:31 AM   [ Ignore ]   [ # 20 ]
Rank
Joined  2008-07-23
Total Posts:  23
New Member

Yes that’s true I put the tuio connect in the main project, it looks like flash don’t see the AS file.

But isn’t it possible that the dots I see in flash from TUIO act like a mouse. So that I can put in a few buttons in my project and then the multitouch is the same as a mouseclick. But then in multimode.

Profile
 
 
Posted: 26 July 2008 11:12 AM   [ Ignore ]   [ # 21 ]
Avatar
RankRankRankRank
Joined  2008-02-12
Total Posts:  842
Moderator

noverflow i even made a my own project to test out your code it doenst work, its like the event is never triggered

 Signature 

My MultiTouch Blog
My Youtube

Profile
 
 
Posted: 26 July 2008 12:08 PM   [ Ignore ]   [ # 22 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Really??? I wonder why it is working on my end?

do either of these work?

http://nuigroup.com/wiki/Building_Your_First_Application/

Profile
 
 
Posted: 26 July 2008 01:19 PM   [ Ignore ]   [ # 23 ]
Avatar
RankRankRankRank
Joined  2008-02-12
Total Posts:  842
Moderator

nope neither

 Signature 

My MultiTouch Blog
My Youtube

Profile
 
 
Posted: 26 July 2008 03:13 PM   [ Ignore ]   [ # 24 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Wow… I wonder why.

I will have to try both from scratch and see.

Profile
 
 
Posted: 26 July 2008 03:41 PM   [ Ignore ]   [ # 25 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

So I think this is the problem with trying to do this when im not anywhere near the table.

The .as packages think they are in a folder called MyTouchApp

so try changing
package app.demo.MyTouchApp{

to

package app.demo{

Profile
 
 
Posted: 26 July 2008 03:46 PM   [ Ignore ]   [ # 26 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Nope never mind..

None of my code works if I start from scratch.

But it is the same EXACT code I am using in an other file that does work.

WTF!

Profile
 
 
Posted: 26 July 2008 04:12 PM   [ Ignore ]   [ # 27 ]
Avatar
RankRankRankRank
Joined  2008-02-12
Total Posts:  842
Moderator

i know i was looking at your code yesterday it seems perfectly fine but it just doesnt work confused

 Signature 

My MultiTouch Blog
My Youtube

Profile
 
 
Posted: 26 July 2008 04:36 PM   [ Ignore ]   [ # 28 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

So there seems to be some really shady stuff in my file that works.

There is a huge hidden shape on the main area called main. I cant copy it over correctly for some reason, and if I delete it, the app stops working.

When I started making my bare bones examples I copied a file and began that way… just deleted everything.

So how who when why… do I get this to work from scratch.
I can post the blank file that will work if need be.

Profile
 
 
Posted: 26 July 2008 04:40 PM   [ Ignore ]   [ # 29 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Figured it out!

You need a movieclip… im not sure how you make this, as I dont know flash at all. But if you make a big black movie clip, all the code will work.

EDIT-----------------

So make a big black rectangle. Right click and convert to symbol… then select movie clip, and hit ok.

Profile
 
 
Posted: 26 July 2008 04:43 PM   [ Ignore ]   [ # 30 ]
RankRank
Joined  2008-05-31
Total Posts:  163
Jr. Member

Im making documentation right now… check back in 30.

Profile
 
 
   
2 of 3
2