I receive a syntax error on some of my navigation buttons.

  • CommonPlace
  • Born
  • Born
  • CommonPlace
  • Posts: 2

Post 3+ Months Ago

I hate to junk up this forum with such an elementary question, but I am totally stumped. I must be missing something obvious.

I'm using Flash 8 and have successfully created buttons that advance through my movie. I did this in the fashion you would expect: I created a button symbol, created a layer just for the button and dropped the symbol onto the stage in the first frame (creating an instance, of course), then created a keyframe in each frame that I needed a new instance of that button. I then went back and renamed each instance in the property inspector to make it available to ActionScript. Finally, I created a layer specifically for ActionScript and loaded it up with scripts. Here's an example:

screen9_btn.onRelease = function() {
gotoAndStop ("screen9");

That button instance works great, as do the others that are instances of that button symbol.

Now comes the confusing part. I followed the same steps for a different button. Once again I created the button symbol first, dropped an instance into the first frame in which I want it to be available, then created a keyframe in the layer each time I wanted a new instance. I've renamed each instance and written the ActionScript that I THOUGHT would allow the user to navigate to other screens. Here's an example (I copied the script straight from a working button, changing only the instance name and the destination screen):

11r_btn.onRelease = function() {
gotoAndStop ("screen12");
};

However, this returns a syntax error whenever I try to test the movie.
Here's the corresponding error below.

**Error** Scene=Scene 1, layer=Actions, frame=100:Line 1: Syntax error.
11r_btn.onRelease = function() {

I get the same sort of error for every instance of this symbol. I can't figure out why one symbol is working while the other does not. Does anyone have an idea of what the problem could be, or something I should investigate further?

I truly appreciate your time.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • zorrcell
  • Newbie
  • Newbie
  • zorrcell
  • Posts: 8

Post 3+ Months Ago

listen u cant have numbers begining with an instance name, try some other instance name
  • CommonPlace
  • Born
  • Born
  • CommonPlace
  • Posts: 2

Post 3+ Months Ago

That was it. I knew it had to be something basic, but the book I'm working from never mentioned that limitation. I put a letter in front of each instance name and now it works like a charm.

Thanks zorrcell!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.