# Help with left pan code

**URL:** https://forum.kirupa.com/t/help-with-left-pan-code/246225
**Category:** Uncategorized
**Created:** [December 8, 2007, 11:25am UTC](https://forum.kirupa.com/t/help-with-left-pan-code/246225 "2007-12-08T11:25:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![m00nz00mer](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@m00nz00mer](https://forum.kirupa.com/u/m00nz00mer)
#### Post date: [December 8, 2007, 11:25am UTC](https://forum.kirupa.com/t/help-with-left-pan-code/246225/1 "2007-12-08T11:25:03Z")

</div>

Hey, ive made a little 360 pan in flash with 2 buttons left pan and right pan. the pan image is in a MC (panClip1) and moves via a large motion tween.

the right button code is:

on (press) {  
\_root.panClip1.gotoAndPlay(\_root.panClip1.\_currentframe);  
}

the left button code is:

on (press) {  
\_root.leftpan = true;  
}

also the code on the clip is…

//EnterFrame Event  
onClipEvent (enterFrame) {

if (\_root.leftpan == true) {  
if( \_root.panClip1.\_currentframe == 1)  
{  
\_global.toggleplay = false;  
}  
frame = this.\_currentframe -1  
this.gotoAndStop (frame);  
}  
}

i want the left button to do the same but when the tween gets to frame 1 it just stops… how can i say… if the frame = 1 then go to and play the end frame(400).
