# Can I use AS to move a MC a specified distance not to a cooridinate?

**URL:** <https://forum.kirupa.com/t/can-i-use-as-to-move-a-mc-a-specified-distance-not-to-a-cooridinate/326113>\
**Category:** flash\
**Created:** [November 23, 2011, 1:52pm UTC](https://forum.kirupa.com/t/can-i-use-as-to-move-a-mc-a-specified-distance-not-to-a-cooridinate/326113 "2011-11-23T13:52:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![media\_mixx](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@media\_mixx](https://forum.kirupa.com/u/media_mixx)\
**Post date:** [November 23, 2011, 1:52pm UTC](https://forum.kirupa.com/t/can-i-use-as-to-move-a-mc-a-specified-distance-not-to-a-cooridinate/326113/1 "2011-11-23T13:52:31Z")

</div>

[TABLE=“class: tborder, width: 100%, align: center”]  
[TR]  
[TD=“class: alt1, bgcolor: #FFFFFF”]Hello,

I am working on a project where I have 5 equal sized panels inside of a MC that uses the following code to load the MC: ( it slides into place in the viewer window)

onClipEvent (load) {  
targetx = 650.0;  
delay = 8;  
}  
onClipEvent (enterFrame) {  
distx = targetx-\_x;  
\_x += distx/delay;  
}

and then I have 5 buttons that all have different cooridinates assigned to them and when you click on button 3, lets say, the MC will move panel 3 into the viewing window if you click on 5 it will slide to 5 and so on:

on (release) {  
menu.targetx = 650.0;  
}

What I would like to do is ALSO move the panels with left and right arrows that act independently of navigation buttons. So that if you were on panel 2 you could advance to panel 3 or back to 1.  
Can I assign AS to the arrows to move the MC a specified distance left or right?

Does someone know what the code is for something like this? Any help would be greatly appreciated.

Thanks[/TD]  
[/TR]  
[/TABLE]
