I found this great sample on how to move objects on the form, allowing a user to move objects (in this case buttons) around the form.
http://cookbooks.adobe.com/index.cfm?event=showdetails&postId=16519
This solution is based on the "fly swatter" example by Thom Parker (http://www.pdfscripting.com) and samples by John Brinkman (http://blogs.adobe.com/formfeed/) looking at x, y, w and h properties.
The code is on exit of buttons...MY QUESTION IS...Is possible to move a static object (e.g. circle) at the same time you are moving the button.
Thank you.
var
gridX = xfa.layout.x(gridPICK);
var
gridY = xfa.layout.y(gridPICK);
var
gridW = xfa.layout.w(gridPICK);
var
gridH = xfa.layout.h(gridPICK);
var
markerDim = xfa.layout.w(mrk) / 2;
//console.println("x: " + gridX + ", " + "y: " + gridY + ", " + "w: " + gridW + ", " + "h: " + gridH + ", " + "marker: " + markerDim);
var
mouseX = event.target.mouseX;
var
newX = (mouseX + "points").toString();
var
mouseY = 595.276 - event.target.mouseY;
var
newY = (mouseY + "points").toString();
if
(mouseX <= gridX + markerDim) { this.x
= (gridX + markerDim + "points").toString(); this.x
= (gridX + markerVim + "points").toString(); }
else
if (mouseX >= gridX + gridW - markerDim) { this.x
= (gridX + gridW - markerDim + "points").toString(); this.x
= (gridX + gridW - markerVim + "points").toString(); }
else
{ this.x
= newX; }
if
(mouseY >= gridY + gridH - markerDim) { this.y
= (gridY + gridH - markerDim + "points").toString(); this.y
= (gridY + gridH - markerVim + "points").toString(); }
else
if (mouseY <= gridY + markerDim) { this.y
= (gridY + markerDim + "points").toString(); this.y
= (gridY + markerVim + "points").toString(); }
else
{ this.y
= newY; }
//console.println("x: " + newX + " y: " + newY);
this.border.edge.color.value
= this.border.fill.color.value;