How to use Tilesheet and Sprites (and where did my events go?)

Hello everyone!

I’m learning how to use Tilesheets. I created an atlas (spritesheet) with arrows. Then I drew that arrow in a Sprite so I can add MouseEvent’s:

var tiles : Tilesheet = new Tilesheet(Assets.getBitmapData("img/sprites.png"));
 var left : Sprite = new Sprite();

 var id : Int = tiles.addTileRect(new Rectangle(0,0,64,128));

Well now there’s a catch. For the Flash target this works:, [0,0,id]);

However this code doesn’t work on native targets (including html5). The alternative is:

tiles.drawTiles(, [0,0,id]);

Using any approach the MouseEvents attached to the Sprite stop working on all targets but Flash.

Strange, isn’t it?

I’ve found a workaround: before drawing the tile into the Sprite, you need to draw something:, 0.0);,0,64,128);; tiles.drawTiles(, [0,0,id]);

Now the MOUSE_OVER and the MOUSE_OUT events work. I couldn’t use ColorTransform though.

Thanks for your time.

The same. Got this issue too