ActionScript Functions

Here are a few tips when using functions in Flash.
function callMe(){}

object.variable1 = callMe();
object.variable2 = callMe;
There is a big difference in how a function works depending on if () are used.
When you use () with a function you are calling it, at which point it runs its code and returns any values. When you do not use () it assigns the function to the variable name. The variable name will then be able to be used to call the function.

Posted by Jason McAlpin

Jason Mcalpin is a full stack developer and game designer. Jason has been programming for over 30 years from the days of punch cards and COBOL. Things have progressed since then and continue to move at a furious pace and Jason explores all of the latest trends in the field.