0 Replies Latest reply on Feb 4, 2011 11:33 PM by Ansury

    Flash Builder Design Mode Bug Workaround (!!!)

    Ansury Level 3

      I've been fighting this annoyance since FB4 came out, and while I still don't think that custom/embedded fonts in design view are fixed by this, I've been able to reproduce this "fix" (workaround) to get design view to show fonts/theme correctly under some very specific circumstances on two separate PCs.

       

      If anyone from Adobe sees this I'd like to know whether this sounds familiar or is possibly logged as a bug already somewhere in JIRA.. if not I could probably do that as long as it won't be a wasted effort.

       

      The problem:

      You're using a Halo theme but certain CSS settings (specifically and possibly limited to FONTS) don't work properly in design view even though they work fine in Flash.  Essentially this makes design view practically useless since choice of font family, size, and weight can effect component sizing if you aren't hard-coding component sizes (ugh)... ruining your efforts to use design view for UI design if your UI has any level of complexity (or uses absolute positioning at all).

       

      The specific circumstances seem to be:

      • You're using the Halo theme (you have no special 'skinning' requirements and want Halo defaults w/only CSS customizations)
      • You've upgraded a Flex 3 project to Flex 4 SDK (not sure if this is needed to reproduce the issue)
      • Using a regular non-embedded font (embedded fonts still do crap out, but even this 'workaround' doesn't fix that problem)
      • You're using swc library files such as the Swiz lib, Mate, Flexlib, etc. (I think it's ANY swc, not specific to any one)
      • This may also only apply when using an "mx only" project (no Spark), since we're using Halo here

       

      The two part fix (as far as I can tell you need BOTH before design view works correctly):

      • In .actionScriptProperties, add the following bolded line after the compiler tag like so:

       

        </compiler>

        <theme themeIsDefault="false" themeIsSDK="true" themeLocation="${SDK_THEMES_DIR}/frameworks/themes/Halo"/>

        <applications>

       

        (I think this may only apply to 'upgraded' projects, as the line does seem to be present in newly created FB4 Halo projects.  My guess is that an "upgraded" project should have such a line added, but doesn't get it due to an oversight/bug.)

       

      • The somewhat painful, and definitely odd part.  Remove all your SWC library files from /libs.  Grab the source code for the libraries and drop them into your project's /src folder as if you'd written them yourself.  (This may require some research and knowledge on special requirements to build the libs, such as with Swiz's compiler metadata compiler settings which you need to put into your project's settings.)  After you get things set up right and the project compiles again, doing a refresh of design view should finally give you proper looking Halo controls and fonts so they look identical to the Flash runtime view.

       

      Why this works, I've no idea.  I suspect it has something to do with that stupid and annoying (and supposedly 'harmless') design mode warning message you get when you include a library like Swiz or Mate in your project.  (Design mode could not load xxxxxxxxxxxxx.swc. It may be incompatible with this SDK, or invalid. (DesignAssetLoader.CompleteTimeout)) - this warning doesn't break your application, people seem to think it's just a harmless warning..but is it breaking design view?


      If anyone has any idea what's going on here, why this 'fixes' the problem (a better work around), or has any other insight I'd love to hear it.  The combo of needing to do two things (in my specific case) to fix the problem really made this a ROYAL PAIN, I still can't believe I found it.