0 Replies Latest reply on Jul 14, 2011 8:21 AM by Jared Ivory

    ASDoc outputting errors from imported .as files

    Jared Ivory Level 1

      Hey all,

      I'm wondering if someone can explain the difference between having a <mx:Script > inside an MXML file, and when you import an .as file <mx:Script source'myFile.as/> and why the asdoc tool treats them differently?

       

      I'm trying to use the asdoc tool to create documentation for an application. A small example, this works creating the docs:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx">
         
          <fx:Script>
              <![CDATA[

                  /** This is my function */
                  public function clicked():void{
                      trace('clicked');
                  }
              ]]>
          </fx:Script>
         
          <s:Button click="clicked()"/>
      </s:Application>

       

      However, the following does not:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx">
         
          <fx:Script source="test.as"/>
         
          <s:Button click="clicked()"/>
      </s:Application>

       

      I get this error, and no docs are created.

      C:\Users\...\Adobe Flash Builder 4\asdoctest\src\test.as(1): col: 1 Error: The public attribute can only be used inside a package.

       

      public function clicked():void{
      ^

       

      Why does it work with the code right in the MXML, but not when it's an imported .as file?