Inside skins/backgrounds/foregrounds
Posted: 22 Jan 2015, 14:04
I'm coming from OS1 development and I've found some differences. Is there some way to catch MouseEvents from within elements living in skins/backgrounds/foregrounds?
Seems that I can attach events in tiles to the tiles themselves, but not their children.
And seems I can't attach anything to backgrounds/foregrounds? What if I want to have birds in the foreground (passing from time to time) and I want them to be clickable?
Actually, my only idea would be moving the birds to the frontmost tile (instead of the foreground), attach a CLICK event, catch event.stageX/stageY and loop thru all the birds to see if the coordinates match with a hitTestPoint(x,y,true).
Same for the "birds" in the background: should I move everything (which needs mouse interaction) to tiles and stick with hitTestPoint to see if an object has been clicked using the hitTestPoint approach?
Cheers!
Seems that I can attach events in tiles to the tiles themselves, but not their children.
And seems I can't attach anything to backgrounds/foregrounds? What if I want to have birds in the foreground (passing from time to time) and I want them to be clickable?
Actually, my only idea would be moving the birds to the frontmost tile (instead of the foreground), attach a CLICK event, catch event.stageX/stageY and loop thru all the birds to see if the coordinates match with a hitTestPoint(x,y,true).
Same for the "birds" in the background: should I move everything (which needs mouse interaction) to tiles and stick with hitTestPoint to see if an object has been clicked using the hitTestPoint approach?
Cheers!