Solved

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

Posted on 2003-11-19
5
403 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now