If you call bgnListener()
like you are now, you'll get an argument mismatch error because the function is expecting to receive a MouseEvent
.
If you want to be able to call bgnListener()
on its own like that, you can define a default value for your argument event
, which can be null
:
function bgnListener(event:MouseEvent = null)
{
// ...
}