Look at line 50 (in the new version, line 47 or something in the old one) of
PromptingTextInput.as.
The old function was:
override public function set text( value:String ):void
{
_textEmpty = value.length == 0;
super.text = value;
invalidateDisplayList();
}
The new function is:
override public function set text( value:String ):void
{
_textEmpty = (!value) || value.length == 0;
super.text = value;
invalidateDisplayList();
}
Doug
On 14 Mar 2007 19:54:24 -0700, Kevin <[EMAIL PROTECTED]> wrote:
great thanks. I'll look at the code, but to speed my search, can you
let me know what line fixed it?
thanks, Kevin
On Mar 14, 2007, at 10:08 PM, Doug McCune wrote:
Quick one-liner fixed the bug. New source is uploaded to FlexLib, and a
new .zip package is available.
Grab it again from http://flexlib.net
Doug
On 14 Mar 2007 18:21:56 -0700, Kevin <[EMAIL PROTECTED]> wrote:
>
> If you want to view this problem you'll need the PromptingTextInput
> component available on the wonderful FlexLib site:
> http://code.google.com/p/flexlib/wiki/ComponentList
>
> Aside from this bug, this is a useful component for those that like
> using prompts in their text input fields.
>
> PromptingTextInput:
> I seem to have encountered a bug in this extension of the TextInput
> Component. I have created a simple test to show the problem. At the
> heart of it, for some reason the binding in the PromptingTextInput
> does not work if the bound variable becomes undefined, whereas it
> works as expected in the Base Class TextInput. Try the sample code
> below and you will see the problem.
>
> 1) Click Enter Test to see that both components bind correctly.
>
> 2) Click Run Test and you will see that the TextInput component
> updates correctly to an empty string if the bound var becomes
> undefined whereas the PromptingTextInput keeps the previous value.
>
> I haven't found the cause of this yet, but I am hoping that some of
> you will be able to spot it quicker than I. I am fairly new to Flex.
>
> I love this component and had started to develop my own version
> (based on one I developed in Flash for AS2) until I saw this. Let me
> know if there is anything I can do to help fix this bug as I use this
> class throughout my current app.
>
> Thanks, Kevin
>
> <mx:Script>
> <![CDATA[
>
> [Bindable]
> public var text1:String;
> [Bindable]
> public var text2:String;
>
> public function enterText():void{
> text1 = "Hello";
> text2 = "There";
> }
>
> public function runTest():void{
> text1 = "Adios";
> text2 = undefined;
> }
> ]]>
> </mx:Script>
>
>
> <mx:VBox x="100" y="100" >
> <mx:Label text="Prompting Text Input" />
> <controls:PromptingTextInput id="test1" text="{text1}" width="100"
> prompt="Enter Text" />
> <controls:PromptingTextInput id="test2" text="{text2}" width="100"
> prompt="Enter Text" />
>
> <mx:Label text="Text Input" />
> <mx:TextInput id="test3" text="{text1}" width="100" />
> <mx:TextInput id="test4" text="{text2}" width="100" />
>
> <mx:Button id="testbutton1" label="Enter Text" click="enterText();" />
> <mx:Button id="testbutton2" label="Run Test" click="runTest();" />
>
> </mx:VBox>
>
>