Instead of MovieClip(class_Boy)
, it should have been simply this
, which is the object that refers to the current instance running the code. class_Boy
is the class itself, used to instantiate new objects.
This kind of problem is prevented when using the common coding standard of naming variables and methods starting with lowercase (parent
) and classes with uppercase (Sprite
). Then when you see MovieClip(ClassBoy)
it's clear there's an error because ClassBoy
is a type of class.
A couple other things that may also help you:
if you follow the standard of starting class names with uppercase, you don't start it with
class
, and you can just name itBoy
methods don't have to start with the class name (
class_Boy_Move
). In fact it's better if they don't, so you don't confuse with the constructor and they end up shorter