1 Reply Latest reply on Sep 27, 2010 1:52 AM by BhaskerChari

    The prefix mx for element mx:Array is not bound

    Scaljeri

      Hi All

       

      I have a component:

       

      <?xml version="1.0" encoding="utf-8"?>

        <mx:Array id="arr">

          <mx:Object label="Flex"

            thumbnailImage="http:/someURL"

            fullImage="http://someURL" />

        </mx:Array>

      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">

      </mx:Canvas>

       

      This gives me an error

       

      The prefix "mx" for element "mx:Array" is not bound

       

      I need a root element here, but I cannot use mx:Canvas, what would be the best choice?

       

      cheers

      Luca

        • 1. Re: The prefix mx for element mx:Array is not bound
          BhaskerChari Level 4

          Hi Luca,

           

          Try to put the Array inside your canvas rather than outside ...

           

          <?xml version="1.0" encoding="utf-8"?
          <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
          <mx:Array id="arr">

              <mx:Object label="Flex"

                thumbnailImage="http:/someURL"

                fullImage="http://someURL" />

            </mx:Array>
          </mx:Canvas>

           

          Why  you dont want to use mx:Canvas as root tag of your component.. ?? However which ever component you use try to put the <mx:Array/> inside your root tag of your component, otherwise you will be thrown the same error as mentioned. The error occurs as the the compiler doesn't recognize the namespace mx for the array since you declared it outside the root tag of your component.

           

           

           

          Thanks,

          Bhasker