Elastic menu question

Hey guys, I’m trying to build a very simple OSX “dock”-like menu in flash… well I’ve got it to where I could load as many items as I like and they move as expected, but they kind of ‘shift’ around, and lost their original position… I can’t figure out how its done to kind of ‘constrain’ them into their grid without crossing the script used to move them… I’ve attached the .fla file for you guys to check out… help is greatly appreciated, thanks a billion!:slight_smile:

-CommanderCool

Unexpected File Format :-\

huh… i’ll try again… i might’ve not saved it just before uploading, heh :blush:

also its mac format… don’t think that makes a diff tho

still unexpected file format

when in doubt … zip it up

ugh… sorry bout this… i hope it works this time…

you can view it also at
http://nathanmal.tripod.com/flash/flash.html

and if it still doesn’t work, heres the script, it’s pretty simple (for now)

// first frame script:

_quality = “HIGH”

box._visible = 0;

numb = 8;

for(i=0;i<numb;i++) {
duplicateMovieClip(box,“box”+i,10+i);
name = “box”+i;

	_root[name]._y = 60;
	_root[name]._x = 60+(i*28);
	_root[name].xstart = 60+(i*28);
	_root[name].ident = i;

}

stop();

// Movieclip (box) script:

onClipEvent (load) {
this.accel = .9;
this.friction = .4;
this.tgtsize = 24;
this.speed = 0;

}

onClipEvent (enterFrame) {

this.speed += (this.tgtsize-this._width)*this.accel;
this.speed *= this.friction;
this._width += this.speed;
this._height += this.speed;

for (i=0; i&lt;_root.numb; i++) {
	name = "box"+i;
	temp = _root[name].ident;
	if (temp&lt;this.ident) {
		_root[name]._x -= this.speed;
	}
	if (temp&gt;this.ident) {
		_root[name]._x += this.speed;
	}
}

}

on (rollOver) {
this.tgtsize = 40;
}

on (rollOut) {
this.tgtsize = 24;
}

uhh… heh, nevermind… i figured it out… works great. I guess i’m just impatient :sigh: I attached it anyway incase someone else is looking for this type of effect.