Creating a user-defined class

  1. Open the 'Schema' pane and in the shortcut bar, click the image labeled 'Classes'.

  2. Right click on the 'Classes' node and select 'New/Class' in the context menu. Change the name of the new class to 'MyClass'.

  3. Right click 'MyClass' and select 'New/Property' in the context menu. Change the name of the new property to 'Value'. This will give all instances of 'MyClass' a value named 'Value'.
  4. Right click 'MyClass' and select 'New/Property' in the context menu. Change the name of the new property to 'Test'. This will give all instances of 'MyClass' a value named 'Test'.
  5. Right click 'MyClass' and select 'New/Method' in the context menu. Change the name of the new method to 'ChangeValue'. All instances of 'MyClass' will now be able to call the 'ChangeValue' method.
  6. Right click 'MyClass' and select 'New/CustomEvent' in the context menu. Change the name of the new event to 'ValueChanged'. All instances of 'MyClass' will now be able to trigger 'ValueChanged' events.
  7. Right click 'MyClass' and select 'New/LuaLocalListener' in the context menu. Change the name of the listener to 'ChangeValueImpl'. This object will be used to implement the 'ChangeValue' method.
  8. Right click 'MyClass' and select 'New/LuaLocalListener' in the context menu. Change the name of the listener to 'HandleValueChange'. This object will be used to handle 'ValueChanged' events.
  9. Right click 'MyClass' and select 'New/LuaLocalListener' in the context menu. Change the name of the listener to 'TestChangeValue'. This object will be used to handle when the 'Test' property is invoked.
  10. Now that our class is implemented, we need a place to test it out.


Copyright 2004 Fragmosoft