- January 25th, 2011
- Write comment
Usually when you set up a button listener in actionscript 3 it listens for a mouse event and then fires a function. That functions needs to have the mouse event set as a parameter like this book now buttom function:
//this is where the functions methods are written
The problem is that if I want to call that function from some other place in my code, like from within another function, ie.
the error fires saying “expecting 1 argument but it received 0.”
The way around this is to declare the argument as null in the function definition, like this:
then we can call it with or without an argument.