Can i set a function when creating an object like i can with variables?
Given i have a container class and a CustomButton class:
function doSomething():Void{}
var button:CustomButton = CustomButton{
posX : 50;
posY = 100;
onMouseClicked: doSomething;
}
Short story: i need the main container object to handle mouse events that occurs in objects placed in the containers.