4 Replies Latest reply on Oct 21, 2008 2:10 PM by Peter Lorent

    Flex 3 Builder Error 1037

    Jim Daniel Level 1
      I'm attempting to do my first actionscript component. The file name RoundedRectBorder.as. My MXML file is

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:rrb="RoundedRectBorder.*" layout="absolute" backgroundColor="0xC49F6E">

      <mx:Script source="RoundedRectBorder.as"/>

      <mx:VBox id="vb1"
      borderSkin="RoundedRectBorder"
      backgroundColor="0xCCCC99"
      backgroundAlpha="0.8"
      cornerRadius="14"
      paddingLeft="20"
      paddingTop="20"
      paddingRight="20"
      paddingBottom="20"
      >
      <mx:Label text="This is a VBox with a custom skin."/>
      </mx:VBox>

      </mx:Application>

      I keep getting the Error "1037 : Packages cannot be nested" and I can not find out how to get rid of this error. I'm using the Flex 3 Builder running on a Mac Book Pro.

      As you can see from the AS3 code the this is just an empty framework so I don't see why this is happening.

      Help!
        • 1. Re: Flex 3 Builder Error 1037
          Level 7
          Try not naming the packaged and the class the same thing.

          "Jim Daniel" <webforumsuser@macromedia.com> wrote in message
          news:gdl8s4$adi$1@forums.macromedia.com...
          > I'm attempting to do my first actionscript component. The file name
          > RoundedRectBorder.as. My MXML file is
          >
          > <?xml version="1.0" encoding="utf-8"?>
          > <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
          > xmlns:rrb="RoundedRectBorder.*" layout="absolute"
          > backgroundColor="0xC49F6E">
          >
          > <mx:Script source="RoundedRectBorder.as"/>
          >
          > <mx:VBox id="vb1"
          > borderSkin="RoundedRectBorder"
          > backgroundColor="0xCCCC99"
          > backgroundAlpha="0.8"
          > cornerRadius="14"
          > paddingLeft="20"
          > paddingTop="20"
          > paddingRight="20"
          > paddingBottom="20"
          > >
          > <mx:Label text="This is a VBox with a custom skin."/>
          > </mx:VBox>
          >
          > </mx:Application>
          >
          > I keep getting the Error "1037 : Packages cannot be nested" and I can not
          > find
          > out how to get rid of this error. I'm using the Flex 3 Builder running on
          > a
          > Mac Book Pro.
          >
          > As you can see from the AS3 code the this is just an empty framework so I
          > don't see why this is happening.
          >
          > Help!
          >
          >
          > package RoundedRectBorder
          > {
          > import mx.skins.RectangularBorder;
          >
          > public class RoundedRectBorder extends RectangularBorder
          > {
          > }
          > }
          >


          • 2. Re: Flex 3 Builder Error 1037
            Peter Lorent Level 2
            The declaration of your package should be package { without the RoundedRectBorder because reading your code the class is in the default package, the directory where your mxml file resides.
            • 3. Re: Flex 3 Builder Error 1037
              Jim Daniel Level 1
              Thanks Guys. Tacking the package name didn't totally solve the problem, I had to remove <mx:Script source="RoundedRectBorder.as"/> from the MXML file also.
              • 4. Re: Flex 3 Builder Error 1037
                Peter Lorent Level 2
                Missed that one, sorry :-)