try event.currentTarget property... that will be the Button in this
case. I usually do something like the following.
private function handleClick(event:Event):void
{
//we know it was a button in this case
var myButton:Button = Button(event.currentTarget);
Alert.show("ID: " + myButton.id);
}
hth
Scott
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com
timgerr wrote:
> How can I get from an event the id of a flex item,
> <mx:Form>
> <mx:FormItem label="User Name" required="true">
> <mx:TextInput name="User Name" id="userName"/>
> </mx:FormItem>
> <mx:FormItem label="Password" required="true">
> <mx:TextInput id="password"/>
> </mx:FormItem>
> </mx:Form>
> <mx:Button id="loginBtn" click="GetID(event)" label="Login" x="99"
> y="90"/>
>
> Here is the function that I want to create
> public function GetEvtID(event:event){
> trave(event.id);
> }
>
> How with the event trigger can I get the id of what called the event.
>
> Thank you,
> timgerr
>
>
>