Touch Event for images and sprites in Starling -
i have class name "tiles". , have class name "tilesmanager" manage tiles. in tilesmanager 25 tiles generating pool.
how can listen each tiles touch event? need learn row , line info of touched tiles?
for(var i:int=0; i<25; i++) { row = % 5; line = math.floor(i / 5); var b:tiles = pool.getsprite() tiles; b.x = 20 + row * 100; b.y = 20 + line * 100; b.row = row; b.line=line; tiles.push(b); play.addchild(b); }
// make sure import starling event not flash 1 // event carry current triggered target , data (tile)
b.addeventlister(event.triggered, ontiletriggered);
Comments
Post a Comment