[solved] "Unexpected for" bug?
I'm just getting into haxeflixel after having used flixel way back in the day. So far I have been really enjoying it.
Does anyone have an idea why "for" loops do not seem to work for me? Wherever in the code I use the word "for," it throws up an "unexpected for" error. Any help would be greatly appreciated!
varcan go anywhere after the class name such as
class PlayState extends..., while most statements need to be inside a function. Its not a bug. you need to move the
forcode and place it inside the function.
Oh, it IS after the class name.
In any case, after cutting and pasting some code around, and closing and reopening the project, it now magically works. Problem solved, I guess?
Thanks for the help regardless.
@blaise_rascal Yes, what he meant is that
forloops are not allowed after a class name / directly in the class body. They must be inside a function.