ColdFusion Muse

File Sizes or Form Limitations on Flash Forms

Mark Kruger December 16, 2005 6:41 PM CFMX 7 Flash Forms Comments (7)

Ask a Muse Asks:
Do you know if there are limitations to either the file-size or the number of fields in a flashform?

There is indeed a limitation to the "flex compiler" that is included with CFMX. The limit is either 32k or 64k depending on who you ask. I cannot find (off hand) the actual MM document that describes the limit. The limit is to the amount of "compiled actionscript". It is affected by pretty much everything you do in the CFFORM tag. Even adding a style can cause a change in the size.

The leads to the unfortunate situation where you are refreshing a form over and over trying to get pixels to line up or a font to size correctly while you hurl epithets at the screen in frustration because of the uninformative error message:

Branch between 71782 and 104556 around line 0 exceeds 32K span. If possible,
please refactor this component.
After calling MIT you realize that refactoring means to reduce the size of the actionscript in the file.

Keep in mind that flash forms are useful in certain situations - a straightforward wizard, a couple of date boxes, a series of dropdowns etc. Macromedia has included the product to "wet your appetite" regarding the power of Flex. Flex is indeed impressive and worth examining as an option. Sad to say the price tag is simply too great and does not match the level of need in most cases.

  • Share:

7 Comments

  • todd's Gravatar
    Posted By
    todd | 12/16/05 8:41 PM
    If you consult Dr. Google you may find there are numerous work arounds for the 32(64)k limit (some people say just keep adding more components to the form).

    Ironically - I used to get this error quite frequently as I have some pretty hefty flash forms on my intranet - but ever since the 7.0.1 updater I haven't hit it once.
  • mkruger's Gravatar
    Posted By
    mkruger | 12/17/05 9:45 AM
    Todd - Thanks for the tip. How does adding more components help?
  • Todd's Gravatar
    Posted By
    Todd | 12/17/05 10:42 AM
    Not quite sure actually. I wish I could offer up a proper technical explanation but adding more components has honestly worked for me. Will it always work? Don't know - I wonder if once a certain size threshold has been exceeded the flex compiler stops checking the size??? Don't honestly know :( - But while developing I've even gone as far as temporarily copying one of my tab navigators (full of different form elements), renaming all of them to avoid name conflicts and hiding it in a height=0 width=0 formgroup to temporarily allow me to compile the form while I'm adding more code.
  • Michael White's Gravatar
    Posted By
    Michael White | 7/6/06 11:11 AM
    according to adobe, During compiling, Flex generates ActionScript code out of your MXML source. It then compiles that into the Flash SWF file. During that process it decides how to break up your source code and generate the ActionScript class code. In Flex 1.5 it doesn't always make the right decision, and so the result is the 32K error. They also suggest adding bogus code to solve the problem. Or adding ?debug=true to the url to test the compiler issue
  • Ed's Gravatar
    Posted By
    Ed | 8/7/07 8:26 AM
    Hi Guys,
    I have done quite a bit of Flash Forms development and ran into actually three errors. One at the 32 K limit... One just before the 64K limit and then a final one at the 64K limit... The 32K message appears to be a warning and you can indeed get past it by just continuing to add components. Just make sure that your form isn't dynamic enough to drop below the 32K limit depending on the data served up for the page. The result is a blank page on production if you have the debug turned off...
    The second error or the 64K warning is also just a warning but you really do not have much room left. The final 64K error appears to be the point of no return. I could not continue past the final 64K limit no matter what I did. I had to refactor my form. You might be suprised as to what will make a difference. Border on formgroups take some space, the built in CF validation takes a lot and even margin settings like indicatorGap takes a bit.
    I have some pretty extensive forms in the app I am working on and have only ran into the final 64K once. I do however run into the 32K warning from time to time and just program past it.:>
    Hope this helps!
    Ed
    eskinner@ourams.com
    <a href="www.ourams.com">www.ourams.com</a>;
  • kapitannwel's Gravatar
    Posted By
    kapitannwel | 8/11/07 2:52 AM
    ive been encountiring the 32k limit. just manipulate everything in your form and your surely will get override the error. i confirmed the comments before me. thanks.
  • kapitannwel's Gravatar
    Posted By
    kapitannwel | 8/11/07 3:19 AM
    most of the times, even simple manipulation on the form's content will work. changing width, height, type, etc. stupid as it may seem but it works.