Move the functionality in the change event of the combo box.You are
assigning the text1.text=sometext. Before this line try to format that
string using TextFormatLayout..
private function combo_change(event:Event):void
{
var s:String=text1.text+event.currentTarget.selectedItem.data;
var txtLayFmt:TextLayoutFormat =
text1.getFormatOfRange(null,0,
s.length);
txtLayFmt.fontFamily = fontDDL.selectedItem;
text1.setFormatOfRange(txtLayFmt,
0,
s.length);
text1.text=s;
}
On Sat, Nov 27, 2010 at 3:52 PM, athi <[email protected]> wrote:
> hi
>
> i am working in flex 4.
>
> i have one text box in flex 4 and if focus in that text box it shoud
> display the one panel which contains fontfamily,fontsize, color etc.
>
> if i select the differnt font family the text box content sholud
> change that font family.
>
> i do well that one
>
>
> Now i have one more combobox which contains some wishes like "best
> wishes" etc.
>
> if i change the combobox item then the text will displays the text
> content+ wishes.
>
> Now the problem is when click that combobox then the text format
> changed normally.
>
> but i want to display the same format.
>
> i use like this
>
> var s:String=text1.text;
> var txtLayFmt:TextLayoutFormat =
> text1.getFormatOfRange(null,0,s.length);
> txtLayFmt.fontFamily = fontDDL.selectedItem;
> text1.setFormatOfRange(txtLayFmt,
> 0,
> s.length);
> text1.text=s;
>
>
> the combobox change event like this
>
> private function combo_change(event:Event):void
>
> {
>
> text1.text =firstText+ "\n\n
> \""+event.currentTarget.selectedItem.data+"\"";
>
> }
>
>
>
> regards
>
> athi
>
>
>
>
>
>
> --
> 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.
>
>
--
Thanks and Regards,
JJain,
If you have knowledge, let others light their candles in it --Margaret
Fuller:
--
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.