# Reverse action?

**URL:** <https://forum.kirupa.com/t/reverse-action/178925>\
**Category:** Uncategorized\
**Created:** [February 15, 2006, 1:30pm UTC](https://forum.kirupa.com/t/reverse-action/178925 "2006-02-15T13:30:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [February 15, 2006, 1:30pm UTC](https://forum.kirupa.com/t/reverse-action/178925/1 "2006-02-15T13:30:53Z")

</div>

**[SIZE=3][FONT=Times New Roman]I have this code which makes 2 objects slide across the page from right to left (PAGE, SUB). I need them to then go back to their position when another button is clicked. Is there a way of just saying ‘reverse function’ or do I have to reverse the code?[/FONT][/SIZE]**

\*\*[FONT=Times New Roman][SIZE=3][/SIZE][/FONT] \*\*

**[FONT=Times New Roman][SIZE=3]I’m trying to write the code to accomodate the changes but can’t quite get it right!![/SIZE][/FONT]**

\*\*[SIZE=3][FONT=Times New Roman][/FONT][/SIZE] \*\*

\*\*[SIZE=3][FONT=Times New Roman][/FONT][/SIZE] \*\*

**[SIZE=3][FONT=Times New Roman]this.onEnterFrame = function()[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman][/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]{\_root.btns.\_alpha = 0}[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]{if (\_root.container1.SUB.\_x\>440) {[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]\_root.container1.SUB.\_x += -30; [/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]} else if (\_root.container1.SUB.\_x\>-30) {[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]\_root.container1.PAGE.\_x += (-40-\_root.container1.PAGE.\_x)/8;[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]\_root.container1.SUB.\_x += (0-\_root.container1.SUB.\_x) /2;}[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]else {delete this.onEnterFrame;[/FONT][/SIZE]**

**[SIZE=3][FONT=Times New Roman]}}}[/FONT][/SIZE]**
