Here's my code:
The errors are one line 123 and 128.
I've googled the error, but I still can't fix it, it's got me baffled for an hour now! I've tried adding curly brace's but still same error.
Help please, thank you!
I left line 123 and 128 like this
function _update(e:Event):void
{
_helicopter.update(_mouseDown);
}
function onEnterFrame(e:Event):void
{'
But I'm getting an error stating that _update is not defined
In the code you posted you are missing 2 trailing "}" It would be easier for you to find if you formatted your code better.
private function onEnterFrame(e:Event):void{
if (startme){
x -= speed;
}
// make me start again when I go off-screen
if (x < -42){
speed = Math.floor(Math.random() * 9 + 5);
height = Math.floor(Math.random() * 200 + 5);
x = 551;
if(updown == 2){
y = 0;
}else{
y = 400 - height;
}
}// <------ you are missing this
}// <-------- you are missing this
When defining nested functions, I don't believe you can specify an access modifier.
public class X extends MovieClip
{
public function f():void
{
/* illegal - nested function with private modifier not allowed */
private function nested():void {};
/* valid - nested function */
function nested():void {};
}
}
So, if you're defining a function within a function, drop the private
access modifier keyword and it should compile.
Personally, I'd recommend pulling those functions to the scope of the main class definition.