This content has been marked as final. Show 3 replies
Use event.afterBounds.x, etc. The event.target points to the object that dispatched event, so event.target.x is the x position at the time the event fired. The NativeWindowBoundsEvent afterBounds and beforeBounds are what you need.
Great, that worked, thanks.
Now I have a small problem. I'm dispatching a MOVE event manually at one point to force a listener to trigger, and it seems that afterBounds is null. Here's how I'm dispatching the event:
While the MOVE listener function is successfully called, event.afterBounds.x throws a null reference exception.
Is there an easy workaround?
If you manually dispatch the event, you have to set the beforeBounds and afterBounds properties yourself.
Note also that simply dispatching events such as this will not trigger the underlying behavior. In other words, dispatching a move event will not move the window. If your "move" handler subsequently moves the window, then a second "move" event will be dispatched.