# Load .swf && sliding menu

**URL:** https://forum.kirupa.com/t/load-swf-sliding-menu/31742
**Category:** flash
**Created:** [September 26, 2003, 1:51pm UTC](https://forum.kirupa.com/t/load-swf-sliding-menu/31742 "2003-09-26T13:51:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)
#### Post date: [September 26, 2003, 1:51pm UTC](https://forum.kirupa.com/t/load-swf-sliding-menu/31742/1 "2003-09-26T13:51:33Z")

</div>

Below is the code from a siding menu that works fine…

[AS]onClipEvent (load) {  
xcenter = \_root.box.\_x + ( \_root.box.\_width/2);  
speed = .03;

```
lowX = _root.box._x;;
highX = lowX - (this._width - _root.box._width);}

```

//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
onClipEvent (enterFrame) {

```
if (_root.box.hitTest(_root._xmouse, _root._ymouse, false)) {

var distance = _root._xmouse - xcenter;
_x -= ( distance*speed );

if (this._x &gt;= lowX) {
	this._x = lowX;} 
else if (this._x&lt;=highX) {
	this._x = highX;}

```

}  
}  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*[/AS]

However after loading this into another movie it wouldn’t move, I made some changes and now it scrolls only to the left. Can someone please tell me what I have over looked ???

[AS]  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
onClipEvent (load) {  
xcenter = \_level0.tops\_contain.box.\_x + ( \_level0.tops\_contain.box.\_width/2);  
speed = .03;

```
lowX = _level0.tops_contain.box._x;;
highX = lowX - (this._width - _level0.tops_contain.box._width);}

```

//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
onClipEvent (enterFrame) {

```
if (_level0.tops_contain.box.hitTest(_root._xmouse, _root._ymouse, false)) {

var distance = _root._xmouse - xcenter;
_x -= ( distance*speed );

if (this._x &gt;= lowX) {
	this._x = lowX;} 
else if (this._x&lt;=highX) {
	this._x = highX;}

```

}  
}  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

[/AS]
