# Action Script 'Define' and 'Statment' errors

**URL:** <https://forum.kirupa.com/t/action-script-define-and-statment-errors/234824>\
**Category:** flash\
**Created:** [August 6, 2007, 2:17pm UTC](https://forum.kirupa.com/t/action-script-define-and-statment-errors/234824 "2007-08-06T14:17:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_dave](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dr\_dave](https://forum.kirupa.com/u/dr_dave)\
**Post date:** [August 6, 2007, 2:17pm UTC](https://forum.kirupa.com/t/action-script-define-and-statment-errors/234824/1 "2007-08-06T14:17:46Z")

</div>

Hey Folks

Trying to load a movie [swf] on top of my main flash page and I get these errors…

* * *

**Error** Symbol=page4, layer=Layer 10, frame=1:Line 1: Statement must appear within on/onClipEvent handler  
videogbutton.onPress = function() {

* * *

It’s a movie clip as a link on one of the pages that has a script attached to it as follows

videogbutton.onPress = function() {  
loadMovieNum(“videog.swf”, 1);  
};

Also I added the instance name videogbutton to that movie clip

Results:

The movie loaded successfully on top of my main page but with those errors.

Any help appreciated.

BTW Newbie here.

Thanks
