User Guide

Table Of Contents
704 Chapter 29: Creating Forms in Macromedia Flash
automatically. You can replace the text.</font></textformat>
</cfformitem>
<cfinput type="text" name="email" label="email"
bind="{firstName.text}.{lastName.text}@mm.com">
<cfformitem type="hrule" style="color:##999900; shadowColor:##DDDD66;
strokeWidth:4"/>
<cfinput type="text" name="phone" validate="telephone" label="Phone">
<!--- Styles control the colors of the current, selected, and
rolled-over dates. --->
<cfinput type="datefield" name="mydate1" label="Date"
style="rollOverColor:##DDDDFF; selectionColor:##0000FF;
todayColor:##AAAAFF">
</cfformgroup> <!--- vbox --->
</cfformgroup> <!--- panel --->
<!--- A style centers the buttons at the bottom of the form. --->
<cfformgroup type="horizontal"style="horizontalAlign:center">
<cfinput type = "submit" name="submit" width="100" value = "Show Results">
<cfinput type = "reset" name="reset" width="100" value = "Reset Fields">
</cfformgroup>
</cfform>
Using ActionScript in Flash forms
ActionScript 2 is a powerful scripting language that is used in Macromedia Flash and other related
products and is similar to JavaScript. You can use a subset of ActionScript 2 code in your Flash
forms.
The following sections tells you how to include ActionScript in your Flash forms, and describes
restrictions and additions to ActionScript that apply to ColdFusion MX Flash forms. It does not
provide information on writing ActionScript. For details on ActionScript and how you can use it,
see the Flash ActionScript 2 documentation, including the documents available in the Flash MX
2004 and Flex sections of Macromedia Livedocs.
Using ActionScript code in CFML
You can use ActionScript in the following attribute of tags in CFML Flash format forms:
Form and control events, such as the onSubmit attribute of the cfform tag, or the onChange
and
onClick attributes of the cfinput tag. The attribute description on the tag reference
pages in CFML Reference list the event attributes.
Bind expressions, which you can use to set field values. For more information on binding data,
see “Binding data in Flash forms” on page 699.
Your ActionScript code must be inline in the form attribute specification. You cannot create your
own ActionScript function as a separate script and use it in the attribute value.
The following example shows a simple Fahrenheit to Celsius converter that does the conversion
directly on the client, without requiring the user to submit a form to the ColdFusion server.
<cfform format="flash" width="200" height="150">
<cfinput type="text" name="fahrenheit" label="Fahrenheit" width="100"
value="68">
<cfinput type="text" name="celsius" label="Celsius" width="100">