Have you tried the latest Flash Builder? If not, the latest beta can be downloaded from http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU
But if you have already tried it, you would have noticed that now ActionScript and MXML editors show ASDoc documentation when you hover over variables/method/class names. See screen shot below:

This means that you can now see the documentation as you are writing code. You can see the method/variable signature or any other documentation associated with any of the class elements. And for all this you don’t need to open the language reference in a separate browser window or search for the documentation.
Behind the scenes Flash Builder pulls this information from the Flex SDK swc files and the ASDoc info is stored in XML files inside the SWC files. For all nightly builds of Flex SDK, the swcs will come with these ASDoc XML files. In case you want to add similar ASDoc XML files to your custom swcs, you can do that too. Currently there is no single command to generate swc with ASDoc XML files, it is done in three simple steps. And the three steps are:
- Generate SWC
- Generate doc XML Files using ASDoc tool
- Update SWC with doc XML fIles
I hope you already know how to generate a swc file. If not, take a look at http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html
In order to generate the doc XML files using ASDoc tool, you will have to run the asdoc tool using -keep-xml=true and -skip-xsl=true
A swc file is a compressed file, so to update it (with doc XML files) you can simply use a zip command.
For reference, you can also look at the build.xml file in the framework project of the Flex SDK. Following is the “doc” target which performs step #2 and #3:
<target name="doc" depends="clean-temp-docs" description="updates framework.swc with asdoc xml"> <!-- Load the <asdoc> task. We can't do this at the <project> level --> <!-- because targets that run before flexTasks.jar gets built would fail. --> <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/lib/flexTasks.jar"/> <condition property="asdoc.jvm.args" value="-Xmx384m"> <os family="windows"/> </condition> <condition property="asdoc.jvm.args" value="-Xmx512m"> <os family="mac"/> </condition> <condition property="asdoc.jvm.args" value="-Xmx512m"> <os family="unix"/> </condition> <!-- Call asdoc to generate dita xml files --> <asdoc output="${FLEX_HOME}/tempDoc" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true"> <compiler.source-path path-element="${basedir}/src"/> <doc-classes class="FrameworkClasses"/> <doc-namespaces uri="http://www.adobe.com/2006/mxml"/> <namespace uri="http://www.adobe.com/2006/mxml" manifest="${basedir}/manifest.xml"/> <jvmarg line="${asdoc.jvm.args}"/> </asdoc> <!-- updates framework.swc with asdoc xml --> <zip destfile="${FLEX_HOME}/frameworks/locale/en_US/framework_rb.swc" update="true"> <zipfileset dir="${FLEX_HOME}/tempDoc/tempdita" prefix="docs"> <include name="*.*"/> <exclude name="ASDoc_Config.xml"/> <exclude name="overviews.xml"/> </zipfileset> </zip> </target>
So give it a try, and if you find any bugs you can log them at http://bugs.adobe.com/flex
Thanks Gaurav for posting this! We’ve been looking for information on how to create the “fat” swc for a while so this is great information for us. Is there any more information somewhere on the two extra options you mention, “keep-xml” and “skip-xsl”, and what they do?
Also, for the near future (as in 4.0), are there any plans to change this 3-step process into a single command?
@Bjorn,
ASDoc tool in the Flex SDK generates intermediate xml files. The final HTML is then generated by running transformations (via xslt) over these xml files. These intermediate xml files are deleted once the asdoc process completes.
When you specify -keep-xml=true the xml files will not be deleted from the disk. And when you specify -skip-xsl=true, ASDoc tool will not run the final transformations step and will exit after generating the xmls.
Currently there is no plan to combine the three step, but feel free to file an enhancement request in JIRA.
-Gaurav
I looked in the latest Flex SDK nightly (4.1.0.15885) and the docs are not present in the SWCs…
My mistake, the ASDoc-enriched SWCs are in /framework/locale.
Fantastic stuff!
Thanks Gaurav! I used your post to create a sample SWC library project in Flash Builder. Download the FXPL here http://blogs.adobe.com/jasonsj/2010/04/build_swcs_with_asdoc_for_flash_builder_4.html.
[...] SWCs that bundle ASDoc content without distributing your source code. Gaurav wrote a great blog post going into detail on how the SDK uses Ant to include ASDoc using framework.swc as an example. You [...]