You can’t know the number.  I guess I would just set a flag so the handler 
returns right away.


On 1/19/10 10:34 PM, "j2me_soul" <j2me_s...@163.com> wrote:






Amazing!

So how can I know what the magic number after the __ID_handler_ I guess is ?

My codes is created by flash catalyst so I can't change each eventlistener to 
actionscript code. Is there a way to solve that ?


在2010-01-20 12:59:15,"Alex Harui" <aha...@adobe.com> 写道:

CreationComplete only fires once so that handler probably isn’t getting removed 
either.

When you type: change=”mytext_changeHandler(event)”
The compiler generates code like this:
    private function 
mytext_changeHandler_10423948(event:TextOperationEvent):void
    {
        mytext_changeHandler(event);
    }

What is in the attribute is really the body of that generated code and it is 
not the handler itself.

On 1/19/10 5:34 PM, "j2me_soul" <j2me_s...@163.com 
<http://tg1a117.mail.163.com/js3/j2me_s...@163.com> > wrote:






Can't remove the eventhandler which wrote in mxml.

   protected function mytext_changeHandler(event:TextOperationEvent):void
   {
    TextInput(event.target).removeEventListener(event.type, 
mytext_changeHandler);
 }

<s:TextInput id="mytext" text="textevent" change="mytext_changeHandler(event) />

The handler function which defined in the application creationComplete handler 
can be removed. I confused ~

 protected function application1_creationCompleteHandler(event:FlexEvent):void
   {
    mytext.addEventListener(TextOperationEvent.CHANGE, mytext_changeHandler);
 }

 protected function mytext_changeHandler(event:TextOperationEvent):void
   {
    TextInput(event.target).removeEventListener(event.type, 
mytext_changeHandler);
 }
<s:TextInput id="mytext" text="textevent"/>







--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to