views:

910

answers:

1

Hi,

Will there be any difference between the swf generated by Flex Builder and mxmlc?

In my application, there is a page with certain fields to be filled in. Upon clicking a button, it opens up a popup. Upon selecting an option in the popup and clicking OK, it makes a request to the server, fetches some data and adds it to the main page.

When the swf is generated by the Flex Builder, everything works just fine. But when the same is generated using an ANT script, upon selecting a value from the popup, I get an error.

[ResultEvent messageId="8638F71F-BCB8-ACFD-E577-B6F97156374D" type="result" bubbles=false cancelable=true eventPhase=2]

This happens only when ANT is used for building the swf.

<mxmlc output="$swf_name" file="$mxml_name" allow-source-path-overlap="true" optimize="true">

I'm using the Cairngorm framework, and the swc is generated before hand.

<compc output="$swc_name">

Also there is a size difference between the final outputs.

The swf is 802 KB when generated from Flex Builder whereas its only 788 KB when generated using ANT. I haven't made any config changes in Flex Builder. It uses the default values(which I believe is optimized) for generating swf.

Am I doing anything wrong with ANT scripts? Do I need to use any different arguments so that I can remove the error which I get only when using the swf built by mxmlc?

Please provide your suggestions.

+2  A: 

There could be differences between your configurations; have a look here -- this Adobe KB article might help you determine whether there are, and if so, what they might be so you can correct them:

http://kb2.adobe.com/cps/404/kb404341.html

I hesitate to mention this second part, because I haven't often toggled between the two compilers (I generally stick with one or the other), but I can say that I've noticed this issue before myself, and as I recall there was a brief mention, in Ely Greenfield's talk at MAX this past month, about a push with Flex 4 to achieve parity between Flex Builder's compilers and their SDK counterparts -- suggesting that such parity doesn't quite exist today. So while I don't have much in the way of details on that, it does seem there are some differences between the two.

Wish I could be more helpful on that -- maybe someone with a little more detail could chime in on it.

Christian Nunciato
Thanks a lot...that KB article was really helpful and looks similar to the problem I'm facing now.I tried to dump the existing configuration of Flex Builder, replace all relative paths with absolute ones.In my build script I'm already adding flex-config.xml as a config file.I added another line to add this config file.In short, I'm adding two config files, one is the flex config and the Flex Builder config.And I get the error--> unable to open 'C:\Program Files\Adobe\Flex Builder3\sdks\3.2.0\frameworks\libs\automation_agent.swc'Any ideas?
whoopy_whale