I am curious as to why this does not work.
I have created a class called MyClass in the global script package app.object
class MyClass: instancesCreated = 0 def __init__(self, initialValue=0): MyClass.instancesCreated += 1 self.value = initialValue
and then created a button that uses the class in the event script
x = app.object.MyClass() print x.instancesCreated y = app.object.MyClass() print x.instancesCreated print app.object.MyClass.instancesCreated
this is the error I receive when I press the button
I am guessing I need to prefix the MyClass with something, but I am not sure what. This is an example staight out of “Jython Essentials”