Is it bad to trigger a function via code like this: myfunctio(null); If it it bad, why is it bad. This could be very handy for me.
If myfunctio handles null gracefully, then there's no reason not to do that. Why would you think it would be a problem? If myfunctio is an event listener, then instead of this: Code: function myfunctio(e:Event):void{ //code which doesn't use e } you might want to do this: Code: funciton myfunctio(e:Event = null):void{ //code which does not use e } Which would let you call myfunctio like this: Code: myfunctio();
function myfunctio(e:Event):void{ //code which doesn't use e }
funciton myfunctio(e:Event = null):void{ //code which does not use e }
myfunctio();
Cool, thanks for that. It just seems like I read somewhere that coding like that was bad form or something. Just wanted to be sure I wasn't going down a bad road before I got too deep. Thanks again.
Forum Rules