26.1.11

Using Classes

I ran the program and got these two errors.


C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 4 1071: Syntax error: expected a definition keyword (such as function) after attribute protected, not static.


C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 15 1084: Syntax error: expecting rightbrace before leftbrace.

I deleted the word static and added a right brace on line fourteen and this is what I got.

C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 4 1071: Syntax error: expected a definition keyword (such as function) after attribute protected, not constant.

For this, I switched to a public constant and got the same error. I've decided to add a function, maybe that will solve the problem. 

internal function Jump(); {
 
startRed():void
startBlue():void
startYellow():void
startOrange():void
}

That didn't solve the problem, so I am goung back. Now the constant is a variable.

Ok, I've gotten rid of that error, and now I have these further down.


C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 12 1078: Label must be a simple identifier.
C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 13 1078: Label must be a simple identifier.
C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 14 1078: Label must be a simple identifier.
C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 15 1078: Label must be a simple identifier.
C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 18 1084: Syntax error: expecting identifier before rightbrace.


I've declared the functions:

public function startRed():void
public function startBlue():void
public function startYellow():void
public function startOrange():void

And...


Awesomely, I ended with just one error at frame 39.


C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 39 1087: Syntax error: extra characters found after end of program.

I delete the extra hanging rightbrace, and...

C:\Users\Owner\Documents\Flash Projects\FlashBlog\Jump\SwitchToExternal\body\Jump.as, Line 1 5006: An ActionScript file can not have more than one externally visible definition: body.Jump, body.startRed


I'll switch the four starts to internal, and...




No comments:

Post a Comment