In Flash Action Scripting, a variable can be assigned to a function which can then be called indirectly by using that particular variable. This is iilustrated below.

function mySystem ( msgl ) { trace ( msgl ); }
iFunc = mySystem; // assign function to variable
iFunc( "Hello" ); // make indirect call

For adding a method to an object, the property is added to the object instance with the help of the (.) operator as shown below.

personl.sayName = function() {
trace ( this.firstName );
}
personl.sayName (); // call the funcation

Name:  Programming Fundamentals - Adding Methods.jpg
Views: 41
Size:  17.8 KB