ColdFusion Muse

Flash Form Illegal Actionscript Part 2 - Not even Comments

Mark Kruger August 30, 2005 10:52 AM CFMX 7 Flash Forms Comments (6)

To follow up on my previous post regarding Coldfusion Flash Forms Limitation Too Draconian. Both Paul Hastings and Ryan Guill have blogs on the topic that add additional information. Paul added in an list post that even actionscript comments are disallowed by the parser. So in other words if you do the following:

//new variable...
   somevar = "";
   // delete button ...    ...some other code...
The flex compiler will complain that the words are not "legal actionscript". That's a bit ridiculous. I'm betting that CF does a pre-compile "dumb" check of the code snippet string using a regex before it's even handed off to the flex compiler - that way they didn't even have to install a modified version of flex.

  • Share:

6 Comments

  • Ryan Guill's Gravatar
    Posted By
    Ryan Guill | 8/30/05 9:05 AM
    I bet youre right about that. Makes you wonder if there may be some workaround for it, or another way to access the flex engine directly.
  • Mike Nimer's Gravatar
    Posted By
    Mike Nimer | 8/30/05 11:18 AM
    You are right, we do perform a regular expression check of the actionscript before we try to compile it. This is why we can't tell the difference between the strings, comments, or actionscript code. And unfortunately since flash is so loose about where you can run actionscript from, we do need to check labels, tooltips, and some of the other places that these checks seem odd.
  • mark's Gravatar
    Posted By
    mark | 8/30/05 11:26 AM
    Mike - thanks for the confirmation, and I understand why you took that tack. Doing it otherwise would definitely be more costly and result in having to maintain 2 separate codebases for flex. However, it's not just "odd" - it puts a real crimp in the use of CFFORM. We build dozens of UI's for productivity tools, document management approval process and the like. It is very common to want to label something like this: "Insert new record" or "delete existing file" etc. So far, while we REALLY like the flash forms look and functionality, we have had to either move to pure flash, use XML Forms or go back to the old tried and true HTML "wizard" approach. Sorry for the criticism - you guys have done a great job overall.
  • Mike Nimer's Gravatar
    Posted By
    Mike Nimer | 8/30/05 11:33 AM
    That's exactly why, I wanted to make sure I could drop in any Flex Hot Fixes in the future. If we branched the code base then that becomes a much larger task.

    Trust me, I hear you and if I can ever open these restrictions up I will.
  • Nathan Hunsaker's Gravatar
    Posted By
    Nathan Hunsaker | 8/30/05 11:53 PM
    I, for one, am not complaining about being able to leverage some Flex functionality in my ColdFusion. It like getting a free limo to work on Friday because you take the city bus to work the other four days. In your case, it seems like the solution is an easy one. Instead of writing "Insert new record", use the label "Create record"; for "Delete existing file" use "Remove existing file". Do you know if buying the Flex server allows you to use these prohibited words in CFForms? If so, it seems like changing a few lines of copy is a huge cost savings. I would also think it's a cheaper solution than a pure flash solution.
  • mark's Gravatar
    Posted By
    mark | 8/31/05 6:32 AM
    Nathan - If the word restriction where the only problem I would agree with you. But we do more than just create and post forms. We use flash with remoting for search and drill-down interaction that goes beyond just a form. In face we DO use flash form exactly as you suggest - a limo in place of our old HTML taxi :) It's just that we run up against it's limitations whenever we try to add complex handlers to it.