Hi Ben (MrB),

Looks like you're going to have to do a little trickery.  Binding the
formatString doesn't seem to change the date formats.  However, if you
re-instantiate the DateFormatter it works:

[Bindable] private var myDate:Date = new Date();
[Bindable] private var formatString:String = "YYYY-MM-DD";

private function changeFormat():void
{
       df = new DateFormatter();
       formatString = "MM/DD/YYYY";
}

<mx:DateFormatter id="df" formatString="{ formatString }"/>

<mx:Text text="{ df.format(myDate) }"/>

-TH

--- In [email protected], "Ben Reynolds" <mrb...@...> wrote:
>
> Hey guys,
>
> Is there a way to trigger the binding on all related items when
> changing the DateFormatter's formatString? eg. MMMM becomes MMM, YYYY
> via actionscript in the following:
>
> <mx:DateFormatter id="df" formatstring="MMMM" />
> <mx:Text text="{df.format(date)}"/>
>
> I'd prefer not to be manually injecting the new format into each of
the
> text objects every time.
>
> Regards,
>
> MrB.
>


Reply via email to