I had the same problem. I encountered this because I made a class called Layer in the default namespace. You might be conflicting with a class name. I think there are some classes in the default namespace that come with tk2d, specifically there is one called Layer.