# Help help help urgently needed as3

**URL:** <https://forum.kirupa.com/t/help-help-help-urgently-needed-as3/294135>\
**Category:** flash\
**Created:** [August 9, 2009, 3:12pm UTC](https://forum.kirupa.com/t/help-help-help-urgently-needed-as3/294135 "2009-08-09T15:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlebouac](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mlebouac](https://forum.kirupa.com/u/mlebouac)\
**Post date:** [August 9, 2009, 3:12pm UTC](https://forum.kirupa.com/t/help-help-help-urgently-needed-as3/294135/1 "2009-08-09T15:12:00Z")

</div>

Hi,

I repost this desperate call for help. I’m a total newbie and i need to create this sliding menu (which code I found here). Problem is I want next and back buttons instead of the several buttons from the original code. Can anyone help on that…please. This is for a very important photography project on Iraq that needs to be running soon…

here’s the code:

const contentHold\_slideSpeed:int = 5;

var contentHold\_initialPosition:Number = contentHold.x;

var contentAssociation:Dictionary = new Dictionary();  
contentAssociation[b1] = contentHold.content1;  
contentAssociation[b2] = contentHold.content2;  
contentAssociation[b3] = contentHold.content3;

var allowSlide:Boolean = true;

function contentHold\_slideToContent($event:MouseEvent):void  
{  
if(allowSlide)  
{  
contentAssociation[$event.target].addEventListener(Event.ENTER\_FRAME, contentHold\_slideToContent\_enterFrame);

```
    marker.y = $event.target.y;
    
    allowSlide = false;
}

```

}

function contentHold\_slideToContent\_enterFrame($event:Event):void  
{  
var targetX:Number = contentHold\_initialPosition - $event.target.x;

```
contentHold.x -= (contentHold.x - targetX) / contentHold_slideSpeed;

if(Math.abs(contentHold.x - targetX) &lt; 1)
{
    contentHold.x = targetX;
    
    allowSlide = true;
    
    $event.target.removeEventListener(Event.ENTER_FRAME, contentHold_slideToContent_enterFrame);
}

```

}

b1.addEventListener(MouseEvent.MOUSE\_UP, contentHold\_slideToContent);  
b2.addEventListener(MouseEvent.MOUSE\_UP, contentHold\_slideToContent);  
b3.addEventListener(MouseEvent.MOUSE\_UP, contentHold\_slideToContent);
