# Actionscript error

**URL:** <https://forum.kirupa.com/t/actionscript-error/96758>\
**Category:** Uncategorized\
**Created:** [December 13, 2003, 2:08am UTC](https://forum.kirupa.com/t/actionscript-error/96758 "2003-12-13T02:08:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![minimalistik](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@minimalistik](https://forum.kirupa.com/u/minimalistik)\
**Post date:** [December 13, 2003, 2:08am UTC](https://forum.kirupa.com/t/actionscript-error/96758/1 "2003-12-13T02:08:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 13, 2003, 3:11am UTC](https://forum.kirupa.com/t/actionscript-error/96758/2 "2003-12-13T03:11:48Z")

</div>

You were missing 2 curly brackets

```auto
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") {
	}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 13, 2003, 3:14am UTC](https://forum.kirupa.com/t/actionscript-error/96758/3 "2003-12-13T03:14:12Z")

</div>

omg! , just the two curly brackets?! lolz

thanks claudio 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 13, 2003, 3:15am UTC](https://forum.kirupa.com/t/actionscript-error/96758/4 "2003-12-13T03:15:22Z")

</div>

welcome 😉
