Actions  -  Move By

The “Move By” Action is used to move an object a set number of pixels on an X/Y axis.

In the example below, you can move the atom around by clicking on the four arrow buttons. The Checkbox button will return the atom to it’s original position (by using the Move To Action).

Here’s how I did it:

  1. Place the “atom” image with the imag tool
  2. Place each of the arrow buttons and the checkbox button with the image tool
  3. Create the following Actions for the Atom image

    This action saves the location of the Atom Image

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

    This action sets up the “restore” action to return the Atom Image to its original position

    When -> Custom -> Edit.. (Create “Restore”)
    Target -> (Atom Image)
    Message -> Move -> Move To
    Parameter(s) -> To Saved Location

  4. Create this Action for the left arrow button

    This action sets up the left-facing arrow to move the Atom Image 10 pixels to the left when clicked

    When -> Mouse -> Clicked
    Target -> (Atom Image)
    Message -> Move -> Move By
    Parameter(s) -> Values...
    Set the Horizontal setting to -10

  5. Create this Action for the right arrow button

    This action sets up the right-facing arrow to move the Atom Image 10 pixels to the right when clicked

    When -> Mouse -> Clicked
    Target -> (Atom Image)
    Message -> Move -> Move By
    Parameter(s) -> Values...
    Set the Horizontal setting to 10

  6. Create this Action for the up arrow button

    This action sets up the up-pointing arrow to move the Atom Image 10 pixels to the right when clicked

    When -> Mouse -> Clicked
    Target -> (Atom Image)
    Message -> Move -> Move By
    Parameter(s) -> Values...
    Set the Vertical setting to -10

  7. Create this Action for the down arrow button

    This action sets up the down-pointing arrow to move the Atom Image 10 pixels to the right when clicked

    When -> Mouse -> Clicked
    Target -> (Atom Image)
    Message -> Move -> Move By
    Parameter(s) -> Values...
    Set the Vertical setting to 10

  8. Create this Action for the checkbox image

    This action restores the Atom Image to its original locatiaon (saved in Step 1) with the Move To action

    When -> Mouse -> Clicked
    Target -> (Atom Image)
    Message -> Move -> Move To
    Parameter(s) -> To Saved 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