Hi,
The solu is similar 2 'this'...what u need to do is, pass a parameter
'event' to the event handler. And in the handler instead of 'this' use
"event.currentTarget". For example,
*<mx:Text text="Sample" click="handleClick(event)"/>
function handleClick(evt:MouseEvent):void{
if( evt.currentTarget.text=="wat ever"){
//wat ever u wnt 2 do.......
}
}*
Hope i was able solve your doubt...
Cheers!!
Raghavendra M
On Thu, Feb 4, 2010 at 1:44 PM, NightAvatar <[email protected]>wrote:
> I am new to Flex but somewhat experienced to javascript. I am used to
> adding simple scripts to elements using "this" to define the element.
> Apparantly that doesn't work with Flex - which really sucks for me. :(
>
> How can I create a script that is assigned to 20+ elements
> (mx:textInput's) and is triggered when a user clicks it (focusIn,
> really). I wanted something like:
> if (this.text=='Placeholder text...') {
> this.text='';
> this.setStyle("color", 0x000000);
> }
>
> Any idea how I can do this? It kind of makes me mad that I can't use
> such a simple script. I am guessing the Flex version will be 5 times
> longer! :(
>
> Thanks for any help! :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.