Skip to main content
Participant
June 21, 2006
Question

error in 8 that wasent there in 5

  • June 21, 2006
  • 5 replies
  • 277 views
I have a bit a code that used to work in 5 that will not work in 8. The script looks like so:

on (release) {
_root.gotoAndPlay("Scene_", add String(this_scene_number-1));
}

The errors im getting are:

**Error** Scene=Scene 1, layer=back button, frame=1:Line 2: ')' or ',' expected
_root.gotoAndPlay("Scene_", add String(this_scene_number-1));

**Error** Scene=Scene 1, layer=back button, frame=1:Line 3: Unexpected '}' encountered
}

Total ActionScript Errors: 2 Reported Errors: 2

Any help is appreciated.
Thanks,
Stephen
This topic has been closed for replies.

5 replies

Inspiring
June 21, 2006
> on (release) {
> _root.gotoAndPlay("Scene_", add String(this_scene_number-1));
> }

That code would never work .. it has syntax errors (the extra comma)

Get rid of the command, and change 'add' to '+' ('add' is no longer
supported)
--
jeckyl


kglad
Community Expert
Community Expert
June 21, 2006
you're welcome.
Participant
June 21, 2006
Thanks, that is what I was looking for.
kglad
Community Expert
Community Expert
June 21, 2006
that code wouldn't work in any version of flash. you could just remove that comma or better try:
Inspiring
June 21, 2006
add (concatenation (strings))
Deprecated since Flash Player 5. Macromedia recommends that you use the
add (+) operator when creating content for Flash Player 5 or later. This
operator is not supported in Flash Player 8 or later.



thanks
stelios


"turnerpro1" <webforumsuser@macromedia.com> wrote in message
news:e7birq$h6l$1@forums.macromedia.com...
> I have a bit a code that used to work in 5 that will not work in 8. The
script
> looks like so:
>
> on (release) {
> _root.gotoAndPlay("Scene_", add String(this_scene_number-1));
> }
>
> The errors im getting are:
>
> **Error** Scene=Scene 1, layer=back button, frame=1:Line 2: ')' or ','
expected
> _root.gotoAndPlay("Scene_", add String(this_scene_number-1));
>
> **Error** Scene=Scene 1, layer=back button, frame=1:Line 3: Unexpected
'}'
> encountered
> }
>
> Total ActionScript Errors: 2 Reported Errors: 2
>
> Any help is appreciated.
> Thanks,
> Stephen
>