Skip to main content
Known Participant
June 12, 2009
Question

Possible to use FlexUnit 4 with Flash CS4?

  • June 12, 2009
  • 2 replies
  • 2964 views

When I try to compile and run FlexUnit 4 tests from Flash CS4, there is a run-time error that no tests were found. I believe the cause is that the custom [Test] metadata didn't make it into the SWF, because MXMLC by default does not keep custom AS3 metadata. And unfortunately, Flash CS4 doesn't allow you to supply additional compiler arguments.

Is there a way to use FlexUnit 4 with Flash CS4?

Robert

This topic has been closed for replies.

2 replies

Participant
March 3, 2010

I ran into this problem as well and found a solution via a tip from one of the Flash team devs (thanks, Jeff!).

Blogged here:

http://www.patrickmowrer.com/content/compiling-custom-as3-metadata-flash-professional

Patrick

Participating Frequently
March 3, 2010

That is fantastic. Thank you so much for posting that here.

June 12, 2009

To the best of my knowledge I don't believe it would be possible to compile Flex Unit 4 Test Cases and Suites from the Flash IDE as much of Flex Unit 4 is built on utilizing metadata which is part of the Flex Framework, and not the Flash Player API.

Best,

Eric

Known Participant
June 12, 2009
... metadata which is part of the Flex Framework, and not the Flash Player API.

This may seem like splitting hairs but I would disagree with this particular statement. Metadata tags are a general mechanism that is not specific to the Flex framework. I can create and use my own tags in an ActionScript-only project. The tags are part of the Flash Player API because they can be accessed at run-time through flash.utils.describeType.

Certainly, the metadata can be accessed at compile-time as well. Flex uses tags like [Bindable] for code-generation magic. But FlexUnit is using metadata at run-time, as I understand it.

Robert

June 15, 2009

Intersting, I was always (mistakenly) under the assumption that meta data was only available in Flex applications, primarily because it is so widley used in the Flex Framework of components, moreover however because I personally haven't used meta data in Flash. As far as Flash CS4 specific projects I am not quite sure. If there isnt a compiler option available to specify that custom meta data is to be retained then I would assume it would not be available. It has been quite some time since I have worked in the Flash IDE, however I would imagine that if Flash applications can be compiled linking to swc libraries then that possibly may work?