@x and @y already have attribute readers for them. Meaning that they're exposed as functions. So $mouse.x and $mouse.y is valid by default.
P.S. throwing an out-of-context snippet of code is not very useful. Maybe specify where to put the code.
P.S. throwing an out-of-context snippet of code is not very useful. Maybe specify where to put the code.