Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a small point and click adventure game for my friend, (and I need the practice) and I cannot figure out why I keep getting this error message. Basically what happens is when I run the program in Macromedia Flash it comes up with an output window saying:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement must appear within on handler

The buttons will also not switch to the frame I have told it to go to. I don't have enough rep to post photos so I have posted two on Imgur.

This link here shows the code I have imputed:

This link here shows the error message that I get when I try to run my program:

I have tried finishing the frames that the code is directed too but have had no luck. I have also tried running the SDK "Check Syntax" and came up with no problems. I suspect that it is not incorrectly written code, but is just missing something. Any ideas?

share|improve this question

closed as off topic by Byte56, Anko, msell, Sean Middleditch, bummzack Jun 5 '13 at 5:59

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This does not seem very game related. Maybe another Stackexchange will get you more results. – thalador Jun 3 '13 at 8:27
I put it on stack overflow and got no answers so give me a break – AspiringGenious Jun 3 '13 at 14:43

I believe that instead of the line

btnjump.onRelease = function() {

you should have the line

on (release) {
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.