1

When I compile my application with ant and incremental build, the embedded images provoke runtime exceptions.

[Embed(source="/assets/logo.png")] 
[Bindable] 
public var logo:Class;

<mx:Image source="{logo}" />

provokes something like

ReferenceError: Error #1065: Variable FileName__embed_mxml__assets_logo_png_2016241504 is not defined.

A work around is to turn off the incremental build, but with this solution, the build process takes to much time (3 - 4 times longer then with incremental build).

With Flex 4.1, this problem didn't exists and it appears while trying to upgrade to Flex 4.6

Here some parts of my ant script

<macrodef name="flex-compile-debug">
    <attribute name="mxmlfile" />
    <attribute name="swffile" />
    <sequential>
        <echo>Debug Build</echo>
        <mxmlc file="@{mxmlfile}" output="@{swffile}" 
            debug="true" incremental="true" keep-generated-actionscript="true" 
            services="${dir.webcontent}/WEB-INF/flex/services-config.xml" context-root="/fem"
            locale="fr_FR" static-link-runtime-shared-libraries="false">
            <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
            <define name="CONFIG::fembeta" value="${flex.beta}"/>
            <source-path path-element="${FLEX_HOME}/frameworks" />
            <source-path path-element="${dir.flex.src}/locale/fr_FR"/>

            <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
                <include name="libs" />
                <include name="locale" />
            </compiler.library-path>
            <compiler.library-path dir="${dir.webcontent}/WEB-INF/flex" append="true">
                <include name="libs" />
                <include name="locale" />
            </compiler.library-path>
        </mxmlc>
    </sequential>
</macrodef>

Thanks for your help

Yves
  • 172
  • 2
  • 14

3 Answers3

0

Couple of things to try:

1) Check the targetPlayerVersion in .actionScriptProperties. It should be at a minimum 11.1

2) Make sure the flash compiler and version are reflected properly in all files.

3) Make sure every single library is recompiled from scratch after you have done the above, then go back to incremental.

Scott A
  • 7,745
  • 3
  • 33
  • 46
  • non of your recommendations work? Till now, I have to recompile (with ant) the hole project and I have to life that I have to wait every time about 55seconds – Yves Nov 21 '12 at 14:35
  • @Yves I personally use fcsh instead of straight mxmlc, via fcshd.py. My compiles are a second or two as a result. You might give that a try as well. – Scott A Nov 21 '12 at 15:47
0

Change your JAVA_HOME settings to JDK 1.6.xx (x32). It helped me.

Dub4ek
  • 46
  • 5
0

the solution is to use Java 7, more informations on this forum : http://www.flashdevelop.org/community/viewtopic.php?f=6&t=12900

molecule
  • 31
  • 4
  • A link to a potential solution is always welcome, but please [add context around the link](//meta.stackoverflow.com/a/8259/169503) so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. Take into account that being _barely more than a link to an external site_ is a possible reason as to [Why and how are some answers deleted?](//stackoverflow.com/help/deleted-answers). – kayess Apr 07 '17 at 09:27