mm, well guys, when it comes to a long function that handles an event, It
wouldn't be convenient to REWRITE it another time to be used manually.
Anyways, I'll give a try on that, and feedback.
Cheers and thanks for the help.
On Sun, Apr 6, 2008 at 2:11 PM, Matt S. <[EMAIL PROTECTED]> wrote:
> 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
>
--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders