New Flash Form Feature #1

With the recent release ColdFusion 7.0.1 (Merrimack) I can finally tell you about some of the new Features. But first, if you haven't downloaded yet - do so!

You can download it here:
http://www.macromedia.com/support/coldfusion/downloads_updates.html#mx7

The first feature to tell you about is support for actionscript functions proper. Now you can create real Actionscript functions inside of your flash forms, no more <cfsavecontent> hacks. This should help to keep you flash forms a lot more manageable, it might even help that 32k limit (since you aren't copy/pasting as much code).. 

Previously you might of done this:
<cfsavecontent var="as1">
alert('hi');
</cfsavecontent>

<cfinput type="Button" onClick="#as1#">

Now you can do this:
<cfform format="flash">
<cfformitem type="script">
    function alertMsg(msg)
    {
         alert(msg);
    }
</cfformitem>

<cfinput type="button" onClick="alertMsg(' this is a button click ')">
<cfinput type="button" onClick="alertMsg(' you clicked the wrong button'">
</cfform>

Comments
Brad Fetter's Gravatar Wow this will make my life alot easier!
# Posted By Brad Fetter | 9/28/05 10:53 AM
Brian Burttram's Gravatar I'm trying to use this feature using Flash forms to redirect a user to a valid URL and am having little success. My function code is as follows:


   function redir(inStr){
         alert('redir = ' + inStr);
         document.URL = inStr;
         alert('redirecting...');
      }


The code on the button is:


The alerts in the code behave a little strange, I would expect the function to wait for a modal window response to the first alert, however what happens is that the first alert is shown, then the second alert on top of it. An accurate and valid URL is making it to the function (as shown using the first alert message), however the user is never redirected to the appropriate page... I've tried using document.URL, document.location, window.location (which never threw an exception, however the Flash form did not compile).

Any assistance or direction you can provide would be much appreciated.

Thanks,
Brian
# Posted By Brian Burttram | 10/4/05 11:45 AM
Brian Burttram's Gravatar I'm trying to use this feature using Flash forms to redirect a user to a valid URL and am having little success. My function code is as follows:


   function redir(inStr){
         alert('redir = ' + inStr);
         document.URL = inStr;
         alert('redirecting...');
      }


The code on the button is:


The alerts in the code behave a little strange, I would expect the function to wait for a modal window response to the first alert, however what happens is that the first alert is shown, then the second alert on top of it. An accurate and valid URL is making it to the function (as shown using the first alert message), however the user is never redirected to the appropriate page... I've tried using document.URL, document.location, window.location (which never threw an exception, however the Flash form did not compile).

Any assistance or direction you can provide would be much appreciated.

Thanks,
Brian
# Posted By Brian Burttram | 10/4/05 12:10 PM
Brian Burttram's Gravatar The only way I was able to get this to work was to use ActionScript's getURL function... It did work though.

Sorry for the double-post, I accidentally F5'd it.

-Brian
# Posted By Brian Burttram | 10/4/05 12:37 PM