Mouse Down problem
Posted: 16 February 2011 01:43 AM   [ Ignore ]
Rank
Joined  2010-11-04
Total Posts:  77
New Member

In my application when I click on screen circle will generate and circle increase in size on holding the click.
As i remove the click circle will disappear.

stage.addEventListener(MouseEvent.MOUSE_DOWN ,downHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, downHandler1);

function downHandler(e:MouseEvent):void
{

circle.graphics.beginFill(0xFFFFFF * (Math.random() + .2), 1);
circle.graphics.drawCircle(0, 0, 5);
circle.graphics.endFill();
circle.x = mouseX;
circle.y = mouseY;
addChild(circle);
tween(circle);
}

function tween(sprite:Sprite):void
{


sprite.alpha = 1;
sprite.scaleX = sprite.scaleY = 1;
Tweener.addTween(sprite, {scaleX: 10, scaleY: 10, alpha: .3, delay: 0, time: 3.5, transition:"linear", onCompleteParams:[sprite]}wink;

}
function downHandler1(e:MouseEvent):void
{

circle.graphics.clear();
}

But when I apply touch events its not working properly.

stage.addEventListener(TouchEvent.MOUSE_DOWN, downHandler);
stage.addEventListener(TouchEvent.MOUSE_UP, downHandler1);

Profile
 
 
Posted: 16 February 2011 02:01 AM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

What error do you receive?

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 16 February 2011 03:58 AM   [ Ignore ]   [ # 2 ]
RankRankRankRank
Joined  2009-08-21
Total Posts:  556
Elite

If you are using touchlib’s touch events, then if you see while touch down + hold it sends continuous MOUSE_DOWN events. That may be the reason. Therefore I use this - http://bubblebird.at/tuioflash/

 Signature 

~~Amit~~

Blog - Twitter - Facebook

Profile
 
 
Posted: 16 February 2011 04:52 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2010-11-04
Total Posts:  77
New Member

Problem with touch event is , on touch it creates a circle but holding touch seems to be not working.
It takes a holding of touch as series of down and up events.

Profile
 
 
Posted: 16 February 2011 04:58 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2010-11-04
Total Posts:  77
New Member

Thanks for reply.
What different properties do these tuio client and managers have?

When to use client and manager and when to use TUIO.init().

Profile
 
 
Posted: 16 February 2011 02:39 PM   [ Ignore ]   [ # 5 ]
RankRankRankRank
Joined  2009-08-21
Total Posts:  556
Elite

here (http://bubblebird.at/tuioflash/guides/) you will find all information !

 Signature 

~~Amit~~

Blog - Twitter - Facebook

Profile