you could compile with the -keep option to see what is output underneath the
covers.
and then what i think might be the case
pure speculation follows
consider that the mxml gets converted to as. now in mxml you could have
<something event="{a=1}"
or
<something event="function(event,'sdfdsf')"
or...
now if i was to write a converter for something like this i would wrap the
function which invokes whatever the user specified (i am not certain if this
is the case) in order to make my approach as flexible as possiblejpn On Mon, Jul 21, 2008 at 12:18 PM, florian.salihovic < [EMAIL PROTECTED]> wrote: > Instead of waiting for an answer i just ran a lil' test: > <?xml version="1.0" encoding="utf-8"?> > <mx:Application creationComplete="eventListener(event)" > xmlns:mx="http://www.adobe.com/2006/mxml"> > <mx:Script> > <![CDATA[ > import flash.utils.getQualifiedClassName; > import mx.events.FlexEvent; > > private function eventListener(event:Event):void { > trace(getQualifiedClassName(event)+"#"+event.type); > switch(event.type) { > case FlexEvent.APPLICATION_COMPLETE: > this.registeredEventListenerTrace(FlexEvent.CREATION_COMPLETE); > this.registeredEventListenerTrace(FlexEvent.APPLICATION_COMPLETE); > this.removeEventListener(FlexEvent.CREATION_COMPLETE, > eventListener, false); > this.removeEventListener(FlexEvent.APPLICATION_COMPLETE, > eventListener, false); > this.registeredEventListenerTrace(FlexEvent.CREATION_COMPLETE); > this.registeredEventListenerTrace(FlexEvent.APPLICATION_COMPLETE); > break; > case FlexEvent.CREATION_COMPLETE: > this.removeEventListener(FlexEvent.CREATION_COMPLETE, > eventListener, false); > this.registeredEventListenerTrace(FlexEvent.CREATION_COMPLETE); > this.registeredEventListenerTrace(FlexEvent.APPLICATION_COMPLETE); > this.addEventListener(FlexEvent.APPLICATION_COMPLETE, eventListener, > false, 0, true); > this.registeredEventListenerTrace(FlexEvent.CREATION_COMPLETE); > this.registeredEventListenerTrace(FlexEvent.APPLICATION_COMPLETE); > break; > } > } > private function registeredEventListenerTrace(type:String):void { > trace("\t" + type + " is registered: " + > this.hasEventListener(type)); > } > ]]> > </mx:Script> > </mx:Application> > > I was surprised that the FlexEvent.CREATION_COMPLETE can't be removed. This > is quite > shocking... > > Best regards. > > --- In [email protected] <flexcoders%40yahoogroups.com>, > "florian.salihovic" <[EMAIL PROTECTED]> wrote: > > > > Quoted from Adobe Flex Developers Guide, page 78 > > > > "However, it is best practice to use the addEventListener() method. > > This method gives you greater control over the event by letting > > you configure the priority and capturing settings, and use event > constants. > > In addition, if you use addEventListener() to add an event handler, you > can > > use removeEventListener() to remove the handler when you no longer need > > it. If you add an event handler inline, you cannot call > removeEventListener() > > on that handler." > > > > - End of Quote - > > > > What i think is a little bit confusing is, that it's said that inline > EventListener can't be > > removed? Or is it just a little bit unluckily expressed? Why can't i just > call > > removeEventListener in ActionScript on the type of event declared in > MXML? > > > > Best regards from Germany > > > > > -- j:pn \\no comment

