# Menu by

**URL:** https://forum.kirupa.com/t/menu-by/135651
**Category:** Uncategorized
**Created:** [January 29, 2005, 12:03am UTC](https://forum.kirupa.com/t/menu-by/135651 "2005-01-29T00:03:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ramo\_integ](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@ramo\_integ](https://forum.kirupa.com/u/ramo_integ)
#### Post date: [January 29, 2005, 12:03am UTC](https://forum.kirupa.com/t/menu-by/135651/1 "2005-01-29T00:03:18Z")

</div>

here is a link to the thread i need help on

> **[Strech menu](https://www.kirupa.com/forum/showthread.php?t=80225)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

in that thread POM created a menu that is really tight…there’s only one problem. i dont know how to link to my external swfs…i posted in that thread and asked but no one is getting back to me…

if someone can please add the piece of code in where it needs to be to link to an .swf i would be more than greatful…

here is the code…(all they told me was it’s in the but\_pressed part)but i dont know how to make it work…

* * *

// Sets the cell that’s on the scene invisible  
p.\_visible = false;

// Button labels  
texts = [“News”, “Bio”, “Video”, “Gallery”, “Tour Dates”, “Contact”] ;  
// Indicates which button # has been pressed  
but\_pressed = 0;

function createMenu (label\_arr) {  
var size = label\_arr.length;  
// Initialize variables:  
// topscale: scale of a button when it’s rolled over (you can change that value)  
// lowscale: scale of a button when another button is rolled over  
cellsize = p.\_width ;  
topscale = cellsize + 100;  
lowscale = (size\*cellsize-topscale)/(size-1);

```
var i = 1;
// Menu creation
while (i &lt;= size) {
	var _mc = p.duplicateMovieClip("p_" + i , 100+Number(i*size));
	_mc.textValue = label_arr[i-1] ;
	_mc.i = i;
	_mc.xscale = cellsize ;
	_mc.onRollOver = _mc.onDragOver = function () {
		but_pressed = this.i ;
		this.gotoAndPlay("start") ;
	} ;
	_mc.onRollOut = _mc.onDragOut = function () {
		but_pressed = 0 ;
		this.gotoAndPlay("back") ;
	} ;
	_mc.onEnterFrame = function () {
		// Rescale the button
		var newxscale ;
		// Compute the new scale of the button
		if (but_pressed != 0) {
			if (but_pressed == this.i) {
				newxscale = topscale;
			} else {
				newxscale = lowscale;
			}
		} else {
			newxscale = cellsize;
		}
		// Classic easing equation
		var xstep = (newxscale-this.xscale)/2;
		if (this.xscale != newxscale) {
			this.xscale += xstep;
		} else {
			xstep = 0 ;
		}
		this._xscale = this.xscale;
	}
	i ++ ;
} ;
// Set the position of the menu cells
this.onEnterFrame = function () {
	// Position of the first cell of the menu
	var ypos = 0;
	var xpos = 0;
	var i = 1;
	while (i &lt;= size) {
		var mc = this["p_" + i] ;
		mc._x = xpos;
		mc._y = ypos;
		xpos = xpos + mc._width ;
		i ++ ;
	} ;
} ;

```

} ;

createMenu(texts);
