2 Replies Latest reply on Oct 26, 2009 1:29 PM by injpix

    MenuBar w/embed font doesnt work

    injpix Level 3

      Hello, attached is my test FlashBuilder project that has 2 mx MenuBar components, which one works and the other doesnt.  The one that works is the one that doesnt embed a font.

       

      Any ideas?

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" initialize="initCollections();">
      
           <fx:Style>
                @namespace s "library://ns.adobe.com/flex/spark";
                @namespace mx "library://ns.adobe.com/flex/halo";
      
                @font-face {
                     src: url("times.ttf");
                     fontFamily: TimesEmbed;
                }
           </fx:Style>
           
           <fx:Script>
                <![CDATA[
                     import mx.collections.XMLListCollection;
                     import mx.events.MenuEvent;          
                     
                     [Bindable]
                     public var menuBarCollection:XMLListCollection;
                     
                     private var menubarXML:XMLList =
                          <>
                               <menuitem label="File" data="top">
                                    <menuitem label="New" data="1A"/>
                                    <menuitem label="Open" data="1B"/>
                                    <menuitem label="Close" data="1B"/>
                                    <menuitem label="Close All" data="1B"/>
                               </menuitem>
                               <menuitem label="Edit" data="top">
                                    <menuitem label="Copy" data="2A"/>
                                    <menuitem label="Delete" data="2A"/>
                                    <menuitem type="separator"/>
                                    <menuitem label="Find" data="2A"/>
                               </menuitem>
                               <menuitem label="View" data="top">
                          
                               </menuitem>
                               <menuitem label="Resources" data="top">
      
                               </menuitem>
                          </>;
                     
                     // Event handler to initialize the MenuBar control.
                     private function initCollections():void 
                     {
                          menuBarCollection = new XMLListCollection(menubarXML);
                     }
                                         
                ]]>
           </fx:Script>   
           
           <s:HGroup>
                <mx:MenuBar id="embedMenuBar"  labelField="@label" dataProvider="{menuBarCollection}" fontFamily="TimesEmbed"/>
                <mx:MenuBar id="nonEmbedMenuBar"  labelField="@label" dataProvider="{menuBarCollection}"/>          
           </s:HGroup>
      
      </s:Application>