I have a component extend UIComponent with lots of classes inside
using Flash Player API. Today I tried to add TextEvent.TEXT_INPUT
listener for a TextField.

private function inputHandler(e:MouseEvent):void
{
   this._tf.setSelection(0,1);
   //this._tf.addEventListener(TextEvent.TEXT_INPUT, textInputHandler,
false, 0, true);
}

I also bind textInput on the top of the component, as TextInput class did:

[Event(name="textInput", type="flash.events.TextEvent")]

But each time when I try to input, error fired:

TypeError: Error #1034: Type Coercion failed: cannot convert
flash.events::[EMAIL PROTECTED] to mx.events.IndexChangedEvent.

And when I add the listener (uncomment above), another error:
TypeError: Error #1034: Type Coercion failed: cannot convert
flash.events::[EMAIL PROTECTED] to mx.controls.TextInput.
(why it was binded to TextInput???)

I have no idea how could get it work. I wonder whether I have to code
it with Flash CS3 and use UIMovieClip with Flex component kit. (Not
sure whether it still problem!?)

I googled this problem, found a bug report but Adobe seems no desire
to fix that bug.
https://bugs.adobe.com/jira/browse/SDK-11156

Any ideas?

Thanks,
George


Reply via email to