7 Replies Latest reply on Jan 26, 2010 4:32 AM by bodrul haque

    The public attribute can only be used inside a package error

    bodrul haque

      I have a flex library project. I have added a HBox component with a public var called hello.

       

      if I declare the variable within a Script tag all is good eg

       

      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">

      <mx:Script>

      <![CDATA[

      public var hello:String="";

      ]]>

      </mx:Script>

      </mx:HBox>

       

      But if I declare the same variable within an actionscript file (test_script.as) i.e.

       

      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">

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

      </mx:HBox>

       

      I get the error "The public attribute can only be used inside a package"

       

      Can we not do this any more?

       

      (BTW. if I don't use the "src" folder and remove it, I don't get the error)