edit: on the event handler i needed to change it from a mouse event to a touch event.
hi i am useing the example as3 that was given in one of the examples (see below) i am first runing flosc then running the TUIO simulator (so that i can simulate a touch panel) i am then runing my flash example from within FlashDeveloper.
everything seems fine the mouse works but when i try click useing the simulator i am not able to click on my square to get to it do anything
yet the record buttons work fine??
anyone know what i am doing wrong?
package
{
// General Imports…
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
// Internal Library Imports…
import com.sample.SampleSquare;
// External Library Imports… (you did not write)
import gs.TweenLite;
import flash.events.TouchEvent;
import flash.events.TUIO;
import flash.events.TUIOCursor;
import flash.events.TUIOObject;
import flash.events.TUIOSimulator;
import flash.events.TUIOEvent;
// Begin Class
public class Main extends Sprite
{
// Embed Font
[Embed(source = “../deploy/Arial.ttf”, fontFamily = “n_font")]
private var n_font:Class;
private var n_format:TextFormat = new TextFormat();
private var n_text:TextField = new TextField();
private var n_square:SampleSquare = new SampleSquare();
// Constructor Method - Adds a Custom Square (SampleSquare)
public function Main()
{
TUIO.init(this, ‘localhost’, 3000, ‘’, true);
this.addChild( n_square );
n_square.x = stage.stageWidth / 2;
n_square.y = stage.stageHeight / 2;
n_square.addEventListener(MouseEvent.MOUSE_DOWN, rotateObj);
n_square.addEventListener(TUIOEvent.TUIO_DOWN, rotateObj);
drawText();
}
// Adds Text to the Square
private function drawText():void
{
n_format.font= “n_font”;
// Not Shown…
}
// Tween Square with External Library (gs.TweenLite)
private function rotateObj(e:MouseEvent):void
{
Trace(’click’
;
TweenLite.to(n_square, 1, {rotation:360,tint:Math.random()*0xFFFFFF}
;
}
}// End Class
}
