views:

1863

answers:

7

I want to see class, function and variable/property, dependencies visually, like NDepend, but for ActionScript 2 or AS3 code.

Any programs or ideas?

Use Doxygen in some way?

FlexUnit?

+5  A: 

Far from a complete solution, but to start you may want to use flex SDK ASDoc to generate the class path structure in a single XML (thanks to the -keep-xml -skip-xsl arguments).

Thereafter you could probably get a nice result if you have a play with graphviz (http://www.graphviz.org/Resources.php).

Automating it all via ANT and you're sorted ; )

Theo.T
+3  A: 

The Flex SDK compilers have a -link-report argument that will give you some good information about the classes compiled into the SWF and their dependencies.

See Examining Linker Dependencies from the Flex 3 documentation for more information.

joshtynjala
+1  A: 

At runtime you an also get information about individual classes via the describeType method (Part of flash.utils). It returns an XML document that describes the class you give to it.

Branden Hall
+1  A: 

ItDepends, a Visual browser for class and package dependencies in Flex applications.

It lacks the visualization capabilities of NDepends but its a big step up from trying to make sense of link reports. Its source is there so if one was sufficiently motivated it could be extended with visualizations.

darrinm
+2  A: 

I was going to post a link to Big Kahuna Burger's Link Report Visualizer, but I see that darrinm has found a much better tool.

Still, could be of some use

LinkReportAIR

+1  A: 

A bit late on this one, but Harald from www.catalysts.cc is about to ship an ActionScript flavor for Structure101g. Structure101 and Structure101g focus on architecture/dependency management.

Just download and install Structure101g from here, go to the Flavors/Install menu and install the ActionScript flavor direct from our flavors repository and then just point it at your code.

pth
Update: New short screencast posted by Harald http://bit.ly/bucZK1.
pth
Does this show function/method caller graphs as well? meaning which methods are being called by which methods? -- and where is "our flavors repository" located on Catalysts website?
Jenko
My reputation precludes me from commenting above :), but yes Structure101 is available for Java. And C++ too via Coverity and Programming Research. ActionScript support arose from us opening it up for third parties to develop backends. We have some folks working on a bunch of other backends which should start appearing shortly.The main thing to note with Structure101g for ActionScript is the project setup wizard is a little klunky because its "generic". And as its still an early access release if you have an issue with it parsing your code let us know and we'll work through it.
pth
Can you add support for AS3 projects that are NOT built in Flex? Also support for Actionscript 2 projects would be simply fabulous. Can I have more information on developing my own flavors for Structure101g?
Jenko
No non-Flex support currently. Our AS flavor is based on the Flex SDK compiler, so if your code compiles with it then there's a good chance it will either work already or we can do an update if you are having problems.Demo on developing your own flavor: http://bit.ly/be9bJe.Developer docs: http://bit.ly/as35vt
pth
Thanks for the information on developing flavors! And are planning to develop flavors for AS3 and AS2?
Jenko
+2  A: 

Download Structure101g and select the Actionscript flavor after installing the software.

I've confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual map of the same.

Take a look at the attached screenshot.

alt text

Hope that helps.

Kevin Boyd
**+550** - Thank you for exploring this software and confirming that it can do function level mapping. I suppose Structure101 could do the same for C++ and Java code. Nice. Congrats on winning the bounty! Thanks for helping.
Jenko