1

I am compiling a very simple app, Main.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark">

    <s:Label
        text="Flex"/>

</s:Application>

With mxmlc (SDK 4.0.0.14159):

mxmlc 
-context-root=a 
-services=.\src\main\webapp\WEB-INF\flex\services-config.xml 
src\main\flex\Main.mxml 
-output src\main\webapp\Main.swf

And also with Flexmojos 3.9 & 4.0-RC2, using SDK 4.0.0.14159:

<configuration>
    <output>src/main/webapp/Main.swf</output>
    <services>src/main/webapp/WEB-INF/flex/services-config.xml</services>
    <contextRoot>a</contextRoot>
</configuration>

The output from both builds creates a valid swf file that works as expected, yet the swf file from mxmlc is much smaller than the Flexmojos version:

mxmlc      Main.swf   43k
flexmojos  Main.swf  367k

This is quite worrying because I am developing in Eclipse (which uses mxmlc) yet my master build script (which uses flexmojos) is producing a totally different file.

Can anyone tell me why this is, and how to rectify it?

Thanks

chris
  • 1,731
  • 4
  • 26
  • 33

2 Answers2

3

It seems, that compilation with flexmojos includes flex framework classes in output swf. And compilation with mxmlc in your case uses framework swfs as RSL.

Timofei Davydik
  • 7,244
  • 7
  • 33
  • 59
  • Thanks, I suspected as much. But do you know how to tell flexmojos to do the same? – chris Oct 05 '11 at 14:58
  • false does not work. – chris Oct 05 '11 at 15:05
  • In principle I agree with what you are saying... but trying to get flexmojos to actually do it is a different matter! – chris Oct 05 '11 at 15:10
  • @chris, could you make some changes in flex-config.xml and watch, if compiled swf would be affected by those changes? If it will (means, that flexmojos really uses that flex-config.xml), please attach the flex-config.xml content to your question. – Timofei Davydik Oct 05 '11 at 20:00
1

MXMLC will be pulling in the flex-config.xml from the Flex SDK install that specifies the default linkage (mostly RSL) for the Flex runtime - meaning a smaller SWF file.

I'm not familiar with how Flexmojos work, so you'll need to learn how to set up the equivalent arguments. It may be possible to tell Flexmojos to use the same default config XML file.

I implemented a Flex build using Gradle and we have different file sizes even though we're supposed to be using the same compiler and the same settings as in Flash Builder (Eclipse) - though the difference is very small and our dependencies are linked as expected.

SteveD
  • 5,396
  • 24
  • 33
  • Flexmojos does actually use the same flex-config.xml file (or a copy of anyway) which is why it is strange that the compilation would be different. – chris Oct 05 '11 at 14:59