|
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:
- Place the “atom” image with the imag tool
- Place each of the arrow buttons and the checkbox button with the image tool
- 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 |
|
- 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 |
|
- 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 |
|
- 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 |
|
- 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 |
|
- 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 |
|
|