Accessing roperties of a class

I am having some confusion in my Xojo project accessing the properties of a class.

I have added the properties to my class object in the IDE and have instantiated an instance of the class in my Open event of the main window.

However, when my code tries to set a value for a property of the class object, the compiler fails with the Item does not exist message. Can someone tell me what I am doing wrong.

Thanks in advance

bobj

You may need a Property for your Window of Type JSONObject.
My guess is that on the Window opening event you have:

Var JSONObject As New JSONObject

and that property is created/destroyed on the Opening event (not available outside the event).

By adding a property to the Window then you will be able to access it but you will need to do this in the opening event:

JSONObject = New JSONObject

Personally I don’t like having the same names but from your screenshot this will be the way to do less changes. Just add the property and change the opening event code.

Ah, I see. Thanks @AlbertoDbobj