# Error: Statement must appear within on/onClipEvent handler

**URL:** https://forum.kirupa.com/t/error-statement-must-appear-within-on-onclipevent-handler/249203
**Category:** flash
**Created:** [January 16, 2008, 1:57pm UTC](https://forum.kirupa.com/t/error-statement-must-appear-within-on-onclipevent-handler/249203 "2008-01-16T13:57:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![p4rm4r](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@p4rm4r](https://forum.kirupa.com/u/p4rm4r)
#### Post date: [January 16, 2008, 1:57pm UTC](https://forum.kirupa.com/t/error-statement-must-appear-within-on-onclipevent-handler/249203/1 "2008-01-16T13:57:51Z")

</div>

**[FlashCS3-AS2.0]**

i’m getting continuous errors of: ‘‘Statement must appear within  
on/onClipEvent handler’’

On one .swf the script is working fine, but on 3 others im gettin 9  
error messages on each.

I have entered the script on the ‘Frame’ on every scene, including the  
one that worked.

Heres the script:

\*\*var groupinfo:Array = [intro, menu, modern, street, freestyle];

var activebtn:MovieClip;

function grow() {  
if (this.\_yscale \< 180) {  
this.\_yscale += 10;  
}  
}

function shrink() {  
if (this.\_yscale \> 100) {  
this.\_yscale -= 10;  
}  
}

function doRollOver() {  
if (this != activebtn) {  
this.onEnterFrame = grow;  
}  
}

function doRollOut() {  
if (this != activebtn) {  
this.onEnterFrame = shrink;  
}  
}

function doClick() {  
activebtn.onEnterFrame = shrink;

delete this.onEnterFrame;  
this.\_yscale = 200;

activebtn = this;  
}

function init() {  
for (var mc in groupinfo) {  
groupinfo[mc].onRollOver = doRollOver;  
groupinfo[mc].onRollOut = doRollOut;  
groupinfo[mc].onRelease = doClick;  
}  
}

init();  
\*\*

Any ideas?
