Hey TH,

  I'd tried binding the formatString but I hadn't considered reinstantiation. 
Thanks. Of course I was hoping for a panacea for all my problems without any 
code whatsoever. :P 

  This actually relates to a larger problem regarding dynamic resource 
switching that I'd got no help on before, and this is the latest in a series of 
kludges to get there.

Thanks again,

  MrB.

--- In [email protected], "Tim Hoff" <timh...@...> wrote:
>
> 
> 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" <mrben1@> 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