<method>
Attaches a function or event handler to an object or class.

Attaches a method to the object that contains this element. The method must have a name .

The name attribute allows the method to be invoked from JavaScript with this name. For example, if a method is defined via:

					<view id="obj">
					<method name="f" args="a, b">
					return a+b;
					</method>
					</view> 

then script code can invoke obj.f(1, 2) to add two numbers.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
allocation "instance" | "class" String "instance" initialize-only
  One of:
class
The attribute will be an attribute of the class; to refer to it, you say lz.classname.attributename .
instance
Each instance will have a method with the specified properties ( name , or args ).

You can set allocation to class to get static attributes. Static properties are attached to the class itself, for example lz.classname .

<attribute name="allowed" value="false"
									type="boolean" allocation="class" />
args string     initialize-only
  The parameter names of this method. The value of this attribute is a comma-separated list of JavaScript identifiers.
name token     initialize-only
  The name of a variable that will be set to this object when the application is started. If this element is directly within a canvas or library element, the global variable and the canvas property with this name will be set to this object. If this element is within another object, that object's property with this name will be set to this object.