Re: [Flashcoders] IDE TextField TextFormat

2008-04-05 Thread EECOLOR
Nope, only to dynamic and input type textfields. Greetz Erik On 4/3/08, laurent [EMAIL PROTECTED] wrote: Hi, Does TextFormat apply to none dynamic textfield ? thx L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

[Flashcoders] Calling Listener Functions

2008-04-05 Thread Omar Fouad
Hi, I've got a function that is called when a listener listens an event like: fancyButton.addEventListener(MouseEvent.CLICK, myFunction); private function myFunction(e:MouseEvent):void { // statements... } If I try to call myFunction using myFunction() , the compiler throws me an error,

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Matt S.
On Sat, Apr 5, 2008 at 8:58 PM, Omar Fouad [EMAIL PROTECTED] wrote: Hi, I've got a function that is called when a listener listens an event like: fancyButton.addEventListener(MouseEvent.CLICK, myFunction); private function myFunction(e:MouseEvent):void { // statements... } If I

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread jonathan howe
Technically speaking, you can instantiate a bogus MouseEvent to call the function: myFunction(new MouseEvent(MouseEvent.CLICK)); However, I only mention this to be complete in directly answering the question. I would think that Matt's suggestion is the more appropriate. -jonathan On Sat, Apr

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Muzak
// version 1 private function myFunction(e:MouseEvent):void { // statements... } fancyButton.addEventListener(MouseEvent.CLICK, myFunction); fancyButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); //version 2 private function myFunction(e:MouseEvent):void { // statements... }

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Rich Shupe
Oops. I forgot to include a link to post about this. Here it is: http://www.learningactionscript3.com/2007/11/21/mandatory-argument-types/ On 4/5/08 8:58 PM, Omar Fouad wrote: Hi, I've got a function that is called when a listener listens an event like:

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Rich Shupe
You can also just send null. myFunction(null); On 4/5/08 9:38 PM, jonathan howe wrote: Technically speaking, you can instantiate a bogus MouseEvent to call the function: myFunction(new MouseEvent(MouseEvent.CLICK)); However, I only mention this to be complete in directly answering the

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Steven Sacks
If you're not actually accessing any of the properties of the MouseEvent in your listener function, you could do the following: (...args) or you could keep it strict and use (e:MouseEvent = null) Either works fine, though the second one is explicitly cleaner. Omar Fouad wrote: Hi, I've

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Steven Sacks
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

Re: [Flashcoders] Calling Listener Functions

2008-04-05 Thread Rich Shupe
I agree. I can see both sides of the point--more granular encapsulation, etc. However, in addition to creating more breadcrumbs to follow, it may not be all that practical in every case. You may not always know you need this and may have to deal with less manageable code more and more as the need