Actions  -  Move To

The “Move To” Action allows you to specify a specific location or page coordinate for the element to move to when the Action is triggered.

The “Drag Me” button below is set with an Action to move it to it’s original position on the page. Drag this button around in the “Sample” area, then click on the “Click Me” button to restore the “Drag Me” button to its original location.
Click Me!
Drag Me!

Here’s how it’s done:

  1. Define your drag area - in this case, I created a Layout Area called “dragspace”
  2. Place your “Drag Me” image in the “dragspace” layout area
  3. Place your “Click Me” image in the “dragspace” layout area
  4. For the “Drag Me” image, create the following Actions:

    (This Action constrains the Drag Me image to the layout area)

    When -> Page -> Page Loaded
    Target -> (DragMe Image)
    Message -> Drag -> Constrain Drag
    Parameter(s) -> To Container Image

    (This Action saves the original location of the Drag Me iamge)

    When -> Page -> Page Loaded
    Target -> (DragMe Image)
    Message -> Object -> Save Location

    These two Actions allow you to drag the Drag Me image around in the layout area. See the Drag Usage note for more details.

    When -> Mouse -> Mouse Down
    Target -> (DragMe Image)
    Message -> Drag -> Start Drag
    Parameter(s) -> Until Mouse Up

    When -> Mouse -> Mouse Up
    Target -> (DragMe Image)
    Message -> Drag -> End Drag

  5. For the “Click Me” image, create this Action:

    When -> Mouse -> Mouse Clicked
    Target -> (DragMe Image)
    Message -> Movement -> Move To
    Parameter(s) -> Saved Location

That should do it - When the page is loaded, you can drag the “Drag Me” object around, and then use the “Click Me” button to restore it to its original location.

Note:  All Actions described in this section have been tested with Fusion 3.x, 4.x, 5.x and MX.
           Actions will not currently work properly when viewed with Netscape 6.0

Go Back to Previous Page

Have a question that you can´t find the answer to? Want to report a possible bug?

Send a help request to NetObjects Technical Support