Ah.. I have made that work....

Thanks for all your help Naveen!!

On Mon, Oct 15, 2012 at 11:14 AM, Malek S <[email protected]> wrote:

> HI Naveen thanks for the reply.
> But current behaviour is its removes prompt the moment textinput gets
> Focus.
> My requiremnt is.. when I click the textinput which has prompt. It should
> still show the prompt.
>
> Once I start typing inside textinput. Only then prompt should disappear..
> Rest of th time it shoudl be visible.
>
> On Fri, Oct 12, 2012 at 10:57 PM, Naveen Malhotra <
> [email protected]> wrote:
>
>> Hi Maleks,
>>
>> I am not sure what is the exact property to do it, Bit you try the code
>> below hope it helps.. :)
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
>>    xmlns:s="library://ns.adobe.com/flex/spark"
>>    xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955"
>> minHeight="600">
>>  <fx:Declarations>
>> <!-- Place non-visual elements (e.g., services, value objects) here -->
>>  </fx:Declarations>
>> <fx:Style>
>>  @namespace s "library://ns.adobe.com/flex/spark";
>> @namespace mx "library://ns.adobe.com/flex/mx";
>>  .focusOutTxt
>>  {
>> color : #999999;
>>  font-style : italic;
>> }
>>  .focusInTxt
>> {
>>  color : #000000;
>> font-style : normal;
>>  radius : 5;
>> borderVisible: false;
>>  focusAlpha:0;
>> paddingLeft: 5;
>>  }
>> </fx:Style>
>>  <fx:Script>
>> <![CDATA[
>>  private function onTiChange(event:Event):void
>> {
>>  if(ti.text != "")
>> lblPrompt.visible = false;
>>  else
>> lblPrompt.visible = true;
>>  }
>> private function onTxtFocusOut():void
>>  {
>> if(ti.text == "")
>>  lblPrompt.visible = true;
>> }
>>  ]]>
>> </fx:Script>
>>  <s:Group styleName="searchTextBG" width="200" top="100" left="100">
>>  <s:Rect top="0" bottom="0" left="0" right="0"
>> radiusX="5" radiusY="5">
>>  <s:fill>
>> <s:SolidColor color="#FFFFFF"/>
>>  </s:fill>
>> <s:stroke>
>>  <s:SolidColorStroke color="#333333"/>
>> </s:stroke>
>>  </s:Rect>
>> <s:Label id="lblPrompt" text="Prompt message" styleName="focusOutTxt"
>> top="5" left="5"/>
>>  <s:TextInput id="ti" change="onTiChange(event);"
>> contentBackgroundAlpha="0" styleName="focusInTxt"
>> focusOut="onTxtFocusOut();" width="100%"/>
>>  </s:Group>
>> </s:Application>
>>
>>
>> On Fri, Oct 12, 2012 at 11:34 AM, Malek S <[email protected]> wrote:
>>
>>>  any one???
>>>
>>> On Thu, Oct 11, 2012 at 4:36 PM, Malek S <[email protected]> wrote:
>>>
>>>> Hi All,
>>>> I have requirement where in i want to show prompt in textinput. Spark
>>>> textinput's prompt property does magic in this case.
>>>> However i want to remove prompt only when user starts typing in.
>>>> Current behaviour is as soon as textinput gets focus prompt is removed.
>>>> can some body help in achiving this?
>>>>
>>>> regards
>>>> maleks
>>>>
>>>
>>>  --
>>> 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.
>>>
>>
>>
>>
>> --
>> Thanks,
>> Naveen Malhotra
>>
>> --
>> 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.
>>
>
>

-- 
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.

Reply via email to