Solved

Operator '+' must be followed by an operand. and other errors'......

Posted on 2003-11-19
5
422 Views
Last Modified: 2008-02-01
needing help with these. Using flash 2004. Not used to syntex............. would give my left eyebrow if someone could fix for me!.

http://webpages.comnetservices.com/gpc.zip

thanks alot!!!




**Error** Symbol=Symbol 46, layer=actions, frame=4:Line 2: Operator '+' must be followed by an operand
         setProperty("/treeSign", _xscale , Number (Number (current_size) + 20) + Number (/:carSpeed * 10));

**Error** Symbol=Symbol 46, layer=actions, frame=4:Line 3: Operator '+' must be followed by an operand
         setProperty("/treeSign", _yscale , Number (Number (current_size) + 20) + Number (/:carSpeed * 10));

**Error** Symbol=Symbol 94, layer=actions, frame=5:Line 5: Operator '*' must be followed by an operand
             carsize = Number (carsize) + Number (4 + Number (4 * /:carSpeed));

**Error** Symbol=Symbol 94, layer=actions, frame=5:Line 6: Operator '*' must be followed by an operand
             carY = Number (carY) + Number (7 + Number (7 * /:carSpeed));

**Error** Symbol=Symbol 107, layer=actions, frame=5:Line 5: Operator '*' must be followed by an operand
             carsize = Number (carsize) + Number (4 + Number (4 * /:carSpeed));

**Error** Symbol=Symbol 107, layer=actions, frame=5:Line 6: Operator '*' must be followed by an operand
             carY = Number (carY) + Number (7 + Number (7 * /:carSpeed));

**Error** Scene=Scene 1, layer=actions, frame=80:Line 33: Unexpected '/' encountered
         if (Number (/:carColour) == 2) {

**Error** Scene=Scene 1, layer=actions, frame=80:Line 35: Unexpected '/' encountered
         } else if (Number (/:carColour) == 3) {

**Error** Symbol=Symbol 108, layer=actions, frame=2:Line 1: Unexpected '/' encountered
         if (Number (/:carSpeed) == 1) {

**Error** Symbol=Symbol 113, layer=actions, frame=2:Line 1: Unexpected '/' encountered
         if (Number (/:carSpeed) == 1) {

**Error** Symbol=Symbol 172, layer=L10, frame=1:Line 2: Operator 'and' must be followed by an operand
         if ((Number (sky_move) == 5) and (Number (/:carSpeed) == 1)) {

**Error** Symbol=Symbol 172, layer=L10, frame=1:Line 5: Operator 'and' must be followed by an operand
         if ((Number (sky_move) == Number (-5)) and (Number (/:carSpeed) == 1)) {

**Error** Symbol=Symbol 172, layer=L10, frame=1:Line 8: Operator 'and' must be followed by an operand
         if ((Number (sky_move) == 10) and (Number (/:carSpeed) == 0)) {

**Error** Symbol=Symbol 172, layer=L10, frame=1:Line 11: Operator 'and' must be followed by an operand
         if ((Number (sky_move) == Number (-10)) and (Number (/:carSpeed) == 0)) {

**Error** Symbol=Symbol 172, layer=L14, frame=1:Line 2: Operator 'and' must be followed by an operand
         if ((mountain_move == 10) and (/:carSpeed == 1)) {

**Error** Symbol=Symbol 172, layer=L14, frame=1:Line 5: Operator 'and' must be followed by an operand
         if ((mountain_move == -10) and (/:carSpeed == 1)) {

**Error** Symbol=Symbol 172, layer=L14, frame=1:Line 8: Operator 'and' must be followed by an operand
         if ((mountain_move == 20) and (/:carSpeed == 0)) {

**Error** Symbol=Symbol 172, layer=L14, frame=1:Line 11: Operator 'and' must be followed by an operand
         if ((mountian_move == -20) and (/:carSpeed == 0)) {

**Error** Symbol=Symbol 172, layer=actions, frame=5:Line 1: Unexpected '/' encountered
         if (/:carSpeed == 1) {

**Error** Symbol=Symbol 172, layer=actions, frame=5:Line 2: Unexpected '/' encountered
             Set("sky_strip:sky_move", -/:skyMoveFast);

**Error** Symbol=Symbol 172, layer=actions, frame=31:Line 1: Unexpected '/' encountered
         if (/:carSpeed == 1) {

**Error** Symbol=Symbol 172, layer=actions, frame=31:Line 2: Unexpected '/' encountered
             Set("sky_strip:sky_move", /:skyMoveFast);

**Error** Scene=Scene 1, layer=L73, frame=130:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Scene=Scene 1, layer=L80, frame=130:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Scene=Scene 1, layer=actions, frame=131:Line 14: Operator '<' must be followed by an operand
         if ((0 < Number (/:carSpeed)) or (Number (step2) == 1)) {

**Error** Scene=Scene 1, layer=actions, frame=131:Line 290: Operator '+' must be followed by an operand
             setProperty("/player", _x , getProperty("/player", _x) - (6 + Number (/:carSpeed * 2)));

**Error** Scene=Scene 1, layer=actions, frame=131:Line 293: Operator '+' must be followed by an operand
             setProperty("/player", _x , Number (getProperty("/player", _x)) + Number (6 + Number (/:carSpeed * 2)));

**Error** Scene=Scene 1, layer=actions, frame=131:Line 322: Unexpected '/' encountered
                 setProperty("/player", _x , /:car_x - 20);

**Error** Scene=Scene 1, layer=actions, frame=131:Line 323: Unexpected '/' encountered
                 Set("/:damage", Number (/:damage) + 5);

**Error** Scene=Scene 1, layer=actions, frame=131:Line 331: Unexpected '/' encountered
                 setProperty("/player", _x , Number (/:car_x) + 20);

**Error** Scene=Scene 1, layer=actions, frame=131:Line 332: Unexpected '/' encountered
                 Set("/:damage", Number (/:damage) + 5);

**Error** Scene=Scene 1, layer=actions, frame=131:Line 342: Unexpected '/' encountered
             if ((Number (/:car_x) >= 286) and (Number (_root.bonus.side) == 1)) {

**Error** Scene=Scene 1, layer=actions, frame=131:Line 343: Unexpected '/' encountered
                 Set("/:score", Number (/:score) + 25);

**Error** Scene=Scene 1, layer=actions, frame=131:Line 354: Operator '>=' must be followed by an operand
             if ((250 >= Number (/:car_x)) and (Number (_root.bonus.side) == 0)) {

**Error** Scene=Scene 1, layer=actions, frame=131:Line 355: Unexpected '/' encountered
                 Set("/:score", Number (/:score) + 25);

**Error** Symbol=Symbol 227, layer=L5, frame=1:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Symbol=Symbol 237, layer=L4, frame=1:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Symbol=Symbol 237, layer=actions, frame=26:Line 1: Operator '-' must be followed by an operand
         bonus = (200 - /:damage) * 10;

**Error** Symbol=Symbol 237, layer=actions, frame=41:Line 1: Operator '-' must be followed by an operand
         timeBonus = 5000 - /:time;

**Error** Symbol=Symbol 237, layer=actions, frame=43:Line 1: Unexpected '/' encountered
         Set("/:score", Number (Number (/:score) + Number (timeBonus)) + Number (bonus));

**Error** Symbol=Symbol 255, layer=L4, frame=1:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Symbol=Symbol 255, layer=actions, frame=47:Line 1: Operator '-' must be followed by an operand
         bonus = (200 - /:damage) * 10;

**Error** Symbol=Symbol 255, layer=actions, frame=50:Line 1: Unexpected '/' encountered
         Set("/:score", Number (/:score) + Number (bonus));

**Error** Symbol=Symbol 255, layer=actions, frame=77:Line 1: Operator '-' must be followed by an operand
         timeBonus = 5000 - /:time;

**Error** Symbol=Symbol 255, layer=actions, frame=80:Line 1: Unexpected '/' encountered
         Set("/:score", Number (/:score) + Number (timeBonus));

**Error** Symbol=Symbol 262, layer=L8, frame=1:Line 2: Unexpected '/' encountered
         if (/:gameSound) {

**Error** Scene=Scene 1, layer=actions, frame=205:Line 4: Unexpected '/' encountered
             if (Number (/:track) == 2) {

Total ActionScript Errors: 47        Reported Errors: 47

0
Comment
Question by:virtex
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
OBCT earned 45 total points
ID: 9783435
I'm not sure if this is the problem, but check that you are not using ActionScript 2.0 because I had a similar problem using mx 2004 and once I switched it to ActionScript 1.0 it worked fine.
I hope this helps.

Cheers

-OBCT
0
 
LVL 1

Author Comment

by:virtex
ID: 9784568
I just tried it and it seems to work but has some major glitchs still. once I figure out how to fix them I will post a answer and you should recieve 1/2 the points or more. thanks alot ^_^
0
 
LVL 9

Expert Comment

by:OBCT
ID: 9784865
If you don't mind, you can post your code here and the errors you're getting and I'll see if I can do anything more to help.
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 9788055
It seems you need to just update all of your code...

setProperty is from Flash 4  ...  live in the now  :)

dot syntax is so much better...

the major problem I see from your posting is that you are using "/:"  instead of a specific reference like "_root."


anywhere you use "set" or are trying to set a variable or property, you should use code like this:

//for a property:

_root.movieClipInstanceName._alpha = 50;

//for a variable:

_root.phoneNumber1 = "(800) 555-1212";


the above movieclip and variable are on the root time line...  if you have a movieclip or variable in a level or movieclip that is not in the root, then you need to make sure you paths are set up correctly...


_root.movieClipInstanceName1.movieClipInstanceName2.variableName = "chicken";


the above sets a variable that is inside of a movieclip that is inside of another movieclip the value of "chicken"...



rp


0
 
LVL 1

Author Comment

by:virtex
ID: 9789055
I got it fixed code wise after I spoke with someone on here(the first guy) after I published it as a older version(which the file is absed off of) and did action script 1.0 it works except there are some mask I need to fix. I got it done so heres the points to the first. Guys thanks for the thoughts and yea I know old habits die hard and am trying to update all my older applications
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
playing flash video on kiosk at startup 6 411
Google Chrome - Where is "Enable Resource Tracking" 2 12,223
Adobe Flash Player won't install on Windows 7 3 259
black magic design 1 130
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question