var pointer;
var status;

function loaded(sender, args)
{
  pointer = sender.findName("ptrCanvas");
  status = sender.findName("status");
}

function mousemove(sender, args) 
{
    x = args.getPosition(null).x;    
    y = args.getPosition(null).y;

    status.Text = "x: " + x + " y: " + y;
      
    // only respond to mouse events if we are inside of the
    // clipping bounds of the app (note that these values are 
    // hardcoded and currently match the clip set on the path canvas)
    
    if (x > 192 && x < 414 && y > 122 && y < 446) 
    {
        pointer.Opacity = 0.8;
        // move the pointer around the canvas
        pointer.SetValue("Canvas.Left", x - 20);
        pointer.SetValue("Canvas.Top", y - 20); 
    }
    else
    {
        pointer.Opacity = 0;
    }
}
