What is the difference between a method and a function? Is it that a method returns a value and a function doesn\'t?
In one line, a method is a function but a function is not necessarily a method. The difference is that a method is used to describe functions defined in classes that are used with instances of those classes.
package {class Example {
public function iAmAMethod():void {
addEventListener("listenerFunctionIsNotAMethod", function(event:Event):void {
trace("inline function, yay!");
});
}
}