Try using  evt.currentTarget.id instead of evt.target.id.

>From your error message, you can see that evt.target is a UITextField
object, rather than the Label which you are expecting.

Cheers,
Toby


On Wed, Jul 23, 2008 at 10:16 PM, timgerr <[EMAIL PROTECTED]> wrote:

> Hello all,
> I am getting this error when I add an event listener like this to a
> lable and then calling the event.target.id.  Here is the error:
>
> #1069: Property id not found on mx.core.UITextField and there is no
> default value
>
> Here is the code:
> import mx.controls.Label;
>                        private function WTF():void
>                        {
>                                var lbl:Label = new Label();
>                                lbl.text = 'Testing measdfasdfas';
>                                lbl.addEventListener(MouseEvent.CLICK,DOME);
>                                lbl.id = 'KKSKS';
>                                addChild(lbl);
>                        }
>                        private function DOME(evt:MouseEvent):void
>                        {
>                                trace(evt.target.id);
>                        }
>
>
> I get the error when the evt.target.id is called, I am not sure why
> this error is being called.  Is there another way to get the label's id?
>
> Thanks,
> timgerr
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>

Reply via email to