Hi,<br>Perhaps this is a noob misunderstanding - but the following is the simplest script I <br>could muster that shows the issue. <br><br>The intent is to instantiate an element on a mouse click, at the position of the mouse click.
<br>I am having trouble deciphering the difference between the global and local mouse events. <br><br>Within the window in the script below, x=0,y=0 seems to be indexed of the window area accounting for the border. <br>However, the canvas_click and local_click are essentially at the same point.
<br><br>The issue with this is that the local_click and canvas_click are being instantiated offset by the title bar height and <br>border wrt the actual mouse click.<br><br>Would this be a bug or am I doing something wrong?
<br>Any help is much appreciated. <br><br>I am using the 4.0.7 SDK to build this. <br><br>thanks,<br>-shishir<br><br><br><canvas debug="true"><br> <handler name="onclick" reference="LzGlobalMouse">
<br> Debug.write('Global onclick x:' + canvas.getMouse('x') + ' y:' + canvas.getMouse('y'));<br> </handler><br><br> <class name="myshow" extends="inputtext">
<br> </class><br><br> <window name="mywindow" x="1" width="25%" height="25%" clickable="true"><br> <handler name="onclick"><br> var local_zero = new myshow (mywindow, { x:"0", y:"0", width:"10", height:"10", bgcolor:"0xff0000"});
<br> var canvas_click = new myshow (mywindow, { x:canvas.getMouse('x'), y:canvas.getMouse('y'), <br> width:"12", height:"12", bgcolor:"0x00ff00"});
<br> var local_click = new myshow (mywindow, { x:mywindow.getMouse('x'), y:mywindow.getMouse('y'),<br> width:"10", height:"10", bgcolor:"0x0000ff"});
<br> Debug.write('Local onclick canvas_click(green) x:' + canvas_click.x + ' y:' + canvas_click.y + <br> '; local_click(blue) x:' + local_click.x + ' y:' + local_click.y);
<br> </handler> <br> </window><br></canvas>