Actionscript error

ive started making a menu but nothing technical just animation to a “rectangular shape” as and converted to an mc…

Ive applied actions to the shape mc like this:

onClipEvent (enterFrame) {
var speed = 4;
var viscosity = 1.3;
difference = whld5 - this._width;
xvelocity = (xvelocity + (difference / speed)) / viscosity;
this._width = this._width + xvelocity;
difference = hhld5 - this._height;
yvelocity = (yvelocity + (difference / speed)) / viscosity;
this._height = this._height + yvelocity;
}
on (rollOver) {
if (oneup == “no”) {
_global.whld1 = 143.2;
_global.hhld1 = 87.5;
_root.b1._x = xhld1;
_global.whld2 = 143.2;
_global.hhld2 = 87.5;
_root.b2._x = xhld2;
_global.whld3 = 143.2;
_global.hhld3 = 87.5;
_root.b3._x = xhld3;
_global.whld4 = 143.2;
_global.hhld4 = 87.5;
_root.b4._x = xhld4;
_global.whld5 = 143.2;

}
on (release) {
if (oneup == “no”) {

}

but the output windows says:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 28: on handlers may not nest within other on handlers
on (release) {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 31: Syntax error.
}

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 11: Statement block must be terminated by ‘}’
on (rollOver) {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 31: Syntax error.
}

whats wrong with the script?

You were missing 2 curly brackets

onClipEvent (enterFrame) {
	var speed = 4;
	var viscosity = 1.3;
	difference = whld5-this._width;
	xvelocity = (xvelocity+(difference/speed))/viscosity;
	this._width = this._width+xvelocity;
	difference = hhld5-this._height;
	yvelocity = (yvelocity+(difference/speed))/viscosity;
	this._height = this._height+yvelocity;
}
on (rollOver) {
	if (oneup == "no") {
		_global.whld1 = 143.2;
		_global.hhld1 = 87.5;
		_root.b1._x = xhld1;
		_global.whld2 = 143.2;
		_global.hhld2 = 87.5;
		_root.b2._x = xhld2;
		_global.whld3 = 143.2;
		_global.hhld3 = 87.5;
		_root.b3._x = xhld3;
		_global.whld4 = 143.2;
		_global.hhld4 = 87.5;
		_root.b4._x = xhld4;
		_global.whld5 = 143.2;
	}
}
on (release) {
	if (oneup == "no") {
	}
}

omg! , just the two curly brackets?! lolz

thanks claudio :wink:

welcome :wink: