1
votes

We've been attempting to compile ASDocs against a Flex 3 Library Project. Our problem is that ASDocs refuses to recognize any custom mxml component that is both created and used within the library.

For example, if we have a custom mxml AdvancedButton control in our library, and we attempt to use it in another mxml class within the library, ASDocs compiler errors out on the parent class file, with "Error: Type was not found or was not a compile-time constant: AdvancedButton".

An error also occurs if we try to extend our custom component. So if our library contains AdvancedButton that extends Button, and ExtraAdvancedButton that extends AdvancedButton, ASDocs will be "Unable to locate specified base class 'AdvancedButton for component class 'ExtraAdvancedButton'".

On the other hand, if AdvancedButton is referenced from an external library, we don't get errors.

This doesn't seem to be an issue if the files are .as, not .mxml. In our case, however, we have nested degrafa based components.

Ideas would be hugely appreciated.

3

3 Answers

2
votes

I had the same problem recently. The trick for me was to add -source-path "src" to the asdoc compiler arguments.

Here is the asdoc command which worked for me:

c:\work\prg\Flex>"c:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.3.0\bin\asdoc.exe" -doc-sources "src" -main-title "PRG documentation" -output "c:\work\prg\Flex\docs" -source-path "c:\work\XmlMappingAS3\src" -source-path "assets\css" -source-path "c:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.3.0\frameworks\projects\framework\src" -source-path "c:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.3.0\frameworks\projects\rpc\src" -external-library-path "c:\work\commonLibraries\Flex\as3commons-reflect-1.0.0.swc" -external-library-path "c:\work\commonLibraries\Flex\Cairngorm.swc" -external-library-path "c:\work\commonLibraries\Flex\spring-actionscript.swc" -external-library-path "c:\work\commonLibraries\Flex\xpath-as3-1.0.0.swc" -external-library-path "c:\work\commonLibraries\Flex\as3corelib.swc" -external-library-path "c:\work\commonLibraries\Flex\as3reflect.swc" -source-path "src"

Also, a great help would be to use the FlashDevelop ActionScript Documentation Generator (that is, in fact, what I used). If you install FlashDevelop on a Windows environment into "c:\Program Files\FlashDevelop", the Documentation Generator is located at "c:\Program Files\FlashDevelop\Tools\asdocgen\ASDocGen.exe".

Good luck!

2
votes

I spent a good couple of hours trying to generate ASDocs for my Flex project and kept getting errors relating to not being able to find base class x/y/z. In the end I found it was because I wasn't telling ASDoc the location of the Flex SWC files:

(For me) C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.4.0\frameworks\libs

Include this path in an additional -library-path argument and you should find it stops any errors about not finding base classes.

This sounds similar to the original problem described above which is missing links to where these custom components sit. Make sure the base directory is included which contains these custom component .as files

0
votes

Are you using the -library-path parameter of asdoc?
But wait, u said u r not getting errors if its referenced from external library - so u r using the library path already, right?

Flex 3 ASDoc doesn't document mxml at all. So may be u shud get flex 4 sdk and try with the asdoc that comes with it.