4 Replies Latest reply on Nov 20, 2009 6:02 AM by _Natasha_

    parse error at XMLList of Menubar

    Mancika

      Hello!
      I dont know if this is the right place to put my question.
      I just started in Flex and getting lots of rror when compiling. This is the latest:
      i'm getting Parse error at '<mx:XMLList>'.
      This is the part of source i'm getting this:
           </mx:Style>
               <mx:MenuBar id="MMEMenu" labelField="@label" showRoot="true" dataProvider="{MMEmenuModel}" fillAlphas="[1.0, 1.0]" fillColors="[#043D01, #000000]" color="#9EE499" x="348" y="24">
               itemClick="dajVsebino(event)">
       
             <mx:XMLList id="MMEmenuModel">
                   <menuitem label="O nas">
                       <menuitem label="reference podjetja" name="refMME" type="check" groupName="one"/>
                       <menuitem label="reference direktor" name="refdir" type="check" groupName="one"/>
                    <menuitem label="Kontakt" name="podatMME" groupName="one" />
                    <menuitem label="Kje smo" name="lokaMME" type="check" groupName="one" />
                   </menuitem>            
                   <menuitem type="separator"/>
                   <menuitem label="Galerija"/>
                       <menuitem label="Slovenija" name="galSvnja" type="check" groupName="one"/>
                       <menuitem label="Nemčija" name="galDeu" type="check" groupName="one" />
                       <menuitem label="Madžarska" name="galHun" type="check" groupName="one"/>
                   </menuitem>
                   <menuitem type="separator"/>
                   <menuitem label="projekti"/>
                       <menuitem label="Slovenija" name="projSvn" type="check" groupName="one"/>
                       <menuitem label="Nemčija" name="projDeu" type="check" groupName="one" />
                       <menuitem label="Madžarska" name="projHun" type="check" groupName="one"/>
                   </menuitem>
                   </mx:XMLList>                     
               </mx:MenuBar>
      I would be very thankful if someone could help me with this, because it's getting very  
      stressful.
      Tnx in advance.

        • 1. Re: parse error at XMLList of Menubar
          _Natasha_ Level 4

          Hi,

           

          this works (changes marked):

           

          <mx:MenuBar id="MMEMenu" labelField="@label" showRoot="true" dataProvider="{MMEmenuModel}" fillAlphas="[1.0, 1.0]" fillColors="[#043D01, #000000]" color="#9EE499" x="348" y="24">
                   itemClick="dajVsebino(event)">
           
                 <mx:XMLList id="MMEmenuModel">
                       <menuitem label="O nas">
                           <menuitem label="reference podjetja" name="refMME" type="check" groupName="one"/>
                           <menuitem label="reference direktor" name="refdir" type="check" groupName="one"/>
                        <menuitem label="Kontakt" name="podatMME" groupName="one" />
                        <menuitem label="Kje smo" name="lokaMME" type="check" groupName="one" />
                       </menuitem>            
                       <menuitem type="separator"/>
                       <menuitem label="Galerija"/>
                           <menuitem label="Slovenija" name="galSvnja" type="check" groupName="one"/>
                           <menuitem label="Nemčija" name="galDeu" type="check" groupName="one" />
                           <menuitem label="Madžarska" name="galHun" type="check" groupName="one"/>
                       </menuitem>
                       <menuitem type="separator"/>
                       <menuitem label="projekti"/>
                           <menuitem label="Slovenija" name="projSvn" type="check" groupName="one"/>
                           <menuitem label="Nemčija" name="projDeu" type="check" groupName="one" />
                           <menuitem label="Madžarska" name="projHun" type="check" groupName="one"/>
                       </menuitem>
                       </mx:XMLList>                     
                   </mx:MenuBar>

          • 2. Re: parse error at XMLList of Menubar
            Mancika Level 1

            Great tkanks!!

            it works like  a charm.

            such a tiny bits, where could I learn this things? ;-)

            tnx again

            • 3. AAAAAAAARRRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHH
              Mancika Level 1

              Hmmmmmm damn. Problems again:

              it sasy 1086: Syntax error: expecting semicolon before position. and bunch of syntax errors in every line after that. It is Actionscript file

              code is(tht error is at line marked with arrow):

                          import mx.events.MenuEvent;
                          import mx.controls.menuClasses.MenuBarItem;
                          import mx.collections.XMLListCollection;
                          import mx.controls.Alert
              [Bindable]
                  public var menuBarVsebina:XMLListCollection;
                  private var MMEmenuVsebinaXML:XMLList =
                   <>
                                                              <item position="top" label="O nas"/>
                                                                  <item label="reference podjetja" name="refMME"/>
                                                                  <item label="reference direktor" name="refdir"/>
                                                              </item>
              here is the error------------------------->  <item position="top" label="Kontakt"/>
                                                                  <item label="O podjetju" name="podatMME"/>
                                                                  <item label="Kje Smo" name="loka"/>
                                                              </item>                                               
                                                              <item position="top" label="Projekti"/>
                                                                  <item label="Slovenija" name="projSvn"/>
                                                                  <item label="Nemčija" name="projDeu" />
                                                                  <item label="Madžarska" name="projHun"/>
                                                              </item>                                                   
                                                              <item position="top" label="Galerija" >
                                                                  <item label="Slovenija" name="galSvn"/>
                                                                  <item label="Nemčija" name="galDeu"/>
                                                                  <item label="Uprava" name="galUprav"/>                                                   
                                                              </item>                                                  

               

                                                          </>;
                          [Bindable] private var menuData:XMLListCollection;
                         
                          private function nalozidata():void
                          {
                              menuData =  new XMLListCollection(menuDataXML.*)
                              MMEbaza.send();
                          }
                         
                          private function dajVsebino(event:MenuEvent):void
                          {
                              currentstate='stateGalerije'
                              Alert.show(event.item.@name, 'kliknil si ' )
                          }
                          private function mouseClick(event:MouseEvent):void
                          {
                              var tempMenu:MenuBarItem =MenuBarItem(event.target)
                             
                              if (XMLList(tempMenu.data).*.length()==0)
                                  {
                                      Alert.show(MenuBarItem(event.target).data.@name, 'Mouse Event' )
                                  }
                          }

               

              urgently need help please.Tnx.

              • 4. Re: AAAAAAAARRRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHH
                _Natasha_ Level 4

                private var MMEmenuVsebinaXML:XMLList =
                     <>
                                                                <item position="top" label="O nas"/>
                                                                    <item label="reference podjetja" name="refMME"/>
                                                                    <item label="reference direktor" name="refdir"/>
                                                                </item>
                here is the error------------------------->  <item position="top" label="Kontakt"/>
                                                                    <item label="O podjetju" name="podatMME"/>
                                                                    <item label="Kje Smo" name="loka"/>
                                                                </item>                                               
                                                                <item position="top" label="Projekti"/>
                                                                    <item label="Slovenija" name="projSvn"/>
                                                                    <item label="Nemčija" name="projDeu" />
                                                                    <item label="Madžarska" name="projHun"/>
                                                                </item>                                                   
                                                                <item position="top" label="Galerija" >
                                                                    <item label="Slovenija" name="galSvn"/>
                                                                    <item label="Nemčija" name="galDeu"/>
                                                                    <item label="Uprava" name="galUprav"/>                                                   
                                                                </item>                                                 

                 

                                                            </>;