No, event listeners are attached to instances, the method would have to be non-static. What would happen if you called MyButtonBar.addNextBtnListener when there were no instances of MyButtonBar at all.
-Josh On Tue, Jun 24, 2008 at 3:55 AM, Ivan Bojer (ivbojer) <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have a simple 'paging' button bar like this: > > <mx:ButtonBar xmlns:mx="http://www.adobe.com/2006/mxml"> > <mx:Script> > <![CDATA[ > static public function addNextBtnListener(listener:Function):void { > ???? > } > ]]> > </mx:Script> > <mx:Button label="Help" /> > <mx:Button label="Back" id="backBtn" /> > <mx:Button label="Next" id="nextBtn" /> > </mx:ButtonBar> > > Is it possible to attach a button click listener to click method from the > static function I provided above? I know I could detect 'click' on button > and then call all of the listeners, but I was curious if I can attach > directly to the button's listener? > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]

