I used a loop to create a series of instances of a class called “Ball”: ball_0, ball_1, ball_2, etc.
But then somewhere else I need to add them on the stage. When I use stage.addChild(Ball(“ball_”+ballNum)) it gives me this error:
TypeError: Error #1034: Type Coercion failed: cannot convert “ball_3” to Ball.
(ballNum was set to 3 at that time)
it seems there’s a new syntax (or something) that I don’t get. I get the same type of errors when using other functions such as stage.contains()
thanks in advance