3 Replies Latest reply on May 9, 2008 9:56 PM by Gregory Lafrance

    dataProvider is XMLList from flat-file

    new2Flex3
      I have a menuBar that is populated from an XML flat-file (as an e4x XMLList). I successfully read the flat-file to determine the saved settings (e.g., display toolTips or not). I can't figure out the way to set the menuBar toggle based on the contents of the XML flat-file. If the file contents for toopTip is to display, I want the respective menuBar toggle enabled (e.g., Display ToolTips). I don't know how to reference the toolTip id in the XML.
        • 1. Re: dataProvider is XMLList from flat-file
          Gregory Lafrance Level 6
          How about if the xml file has tooltip text for a menuitem, then set toggle to true, if there is no tooltip text for a menuitem in the xml, then set toggle to false. Don't know if I clearly understand your problem though.
          • 2. Re: dataProvider is XMLList from flat-file
            all4Flex
            The menuBar item reads as (base don an XML file):
            <submenuItem id="tooltip_b" button_label="ToolTip" type="check" toggled="false"/>
            I have another XML file that has settings:
            <system_info display_user_name="Yes" display_toolTips="Yes" debug="yes"/>
            If the file's display_toolTips attribute is Yes, then I want to set tooltip_id.toggled=true - hoever, since the menuBar is an XML, I don't know how to get to the ID.
            In orhter parts of my project that don't use XML files, I know I can use the MXML values directly.
            ActionScript: debugtext_id.text = "debug text goes here";
            Flex: <mx:TextArea id="debugtext_id" toolTip="Debug Text" visible="false" />
            • 3. Re: dataProvider is XMLList from flat-file
              Gregory Lafrance Level 6
              I don't know what ID you are trying to get to, as an ID is not in your xml. If the xml is read in by Flex as E4X, this FB3 help link may help in parsing the xml:

              The E4X approach to XML processing