0
votes

My code is this:

symboll.addEventListener(Event.ENTER_FRAME, symboll);
function ball_hit_wall(e:Event):void{
        (symboll.hitTestObject(box));
{   
        gotoAndPlay(3)
    }
}

And the error message that i am getting is this:

1067: Implicit coercion of a value of type flash.display:SimpleButton to an unrelated type Function.

I'm new to actionscript, what did i do wrong

symboll and box are both buttons

1

1 Answers

0
votes

Method addEventListener expects second argument of the type Function, while you're providing type SimpleButton.

Try replace your code

symboll.addEventListener(Event.ENTER_FRAME, symboll);

with

symboll.addEventListener(Event.ENTER_FRAME, ball_hit_wall);