Jason,
Is that considered bad practice in lieu of code readability or is there another 
pitfall I just don't see?
I'm only asking because in my short past of writing AS3 I called Event Handlers 
with an argument of 'null' sometimes to save on function single-liners like 
doIt(); 

Best
Thomas


------------------------------

Message: 9
Date: Thu, 16 Dec 2010 19:48:16 -0500
From: "Merrill, Jason" <[email protected]>
Subject: RE: [Flashcoders] error mesg
To: Flash Coders List <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; CHARSET=US-ASCII

You shouldn't be manually calling an event handler in your code.  If you want 
multiple event handler functions to run the same set of code, then create a 
third function that they all call.  

function onSomething(event:Event):void
{
        doIt();
}

function onSomethingElse(event:Event)
{
        doIt();
}

function doIt():void
{
        //doStuff.
}


 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to