True. But then again, if at the start you already find yourself
needing to call a function outside of the context of a mouse event,
doesnt that indicate that locking it in as such, and then finding
workarounds, might be more trouble than its worth?
2ยข ....
.m
On Sat, Apr 5, 2008 at 11:06 PM, Steven Sacks <[EMAIL PROTECTED]> wrote:
> I disagree with this approach. It's unnecessary and makes code less
> manageable. It's cleaner to set the argument as optional (event = null)
> than write another subroutine.
>
>
> Matt S. wrote:
>
> >
> > You might want to separate the functions, so you would have
> > myFunction(), which you could call from anywhere, and myClickHandler,
> > which would handle the mouse event specifically. So:
> >
> > fancyButton.addEventListener(MouseEvent.CLICK, myClickHandler);
> >
> > private function myClickHandler(e:MouseEvent):void {
> > myFunction();
> > }
> >
> > private function myFunction():void{
> > //blah blah...
> > }
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> >
> >
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders