在FLEX的RichTextEditor中添加自定义字体名

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/11/23/populating-the-nested-font-family-combobox-control-in-a-flex-richtexteditor-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Array id="fontFamilyArr">
        <mx:String>Arial</mx:String>
        <mx:String>Verdana</mx:String>
        <mx:String>Comic Sans MS</mx:String>
    </mx:Array>

    <mx:RichTextEditor id="richTextEditor"
            fontFamilyArray="{fontFamilyArr}" />

</mx:Application>

同时你可以像下面这样写:
richTextEditor.fontFamilyArray = fontFamilyArr;
或用数据绑定的方法
richTextEditor.fontFamilyCombo.dataProvider = fontFamilyArr;

你可能感兴趣的:(xml,Blog,Flex,Adobe)