In JavaScript we have document.elementfrompoint to get an element based on coordinates.
Is there any thing like that in Openlaszlo to get a view based on coordinate?
In JavaScript we have document.elementfrompoint to get an element based on coordinates. Is there
Share
There is no direct support for that functionality in OpenLaszlo, but for ActionScript 3 based runtimes you can utilize the flash.display.DisplayObjectContainer#getObjectsUnderPoint() method. In the DHTML runtime, you can use the document.elementFromPoint(x, y), and based on Quirksmode that should be supported by all modern browsers.
Here is an example program implementing an
canvas.elementFromPoint()method:There are 4 views, one background view scaled to 100% x 100%. And three color views: red, green and blue – with the blue one being the top one. When clicking on the view, the correct view object is returned.
The code has been tested in the DHTML runtime with Chrome 22.0, Firefox 16.0.1, and Opera 12.02. Flash should work in every browser, I haven’t tested with IE.