ColdFusion Muse

Flash Form Illegal Actionscript Part 2 - Not even Comments

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.

Comments
Ryan Guill's Gravatar 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.
# Posted By Ryan Guill | 8/30/05 9:05 AM
Mike Nimer's Gravatar 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.
# Posted By Mike Nimer | 8/30/05 11:18 AM
mark's Gravatar 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.
# Posted By mark | 8/30/05 11:26 AM
Mike Nimer's Gravatar 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.
# Posted By Mike Nimer | 8/30/05 11:33 AM
Nathan Hunsaker's Gravatar 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.
# Posted By Nathan Hunsaker | 8/30/05 11:53 PM
mark's Gravatar 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.
# Posted By mark | 8/31/05 6:32 AM



Blog provided and hosted by CF Webtools. Blog Sofware by Ray Camden.