MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Dokumentacja Strona 168

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 369
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 167
Chapter 590
4 Create the getArray method that the Flash Communication Server will invoke.
<cffunction name="getArray" output="false" description="Creates and
returns an array of 3 items" access="remote">
<cfset months = ArrayNew(1)>
<cfset months[1] = "January">
<cfset months[2] = "February">
<cfset months[3] = "March">
<cfreturn months>
</cffunction>
</cfcomponent>
5
Save the file as simple.cfc in the simple directory under the directory where you publish all of
your ColdFusion MX files.
Sample 2: Sending Mail
This sample illustrates how to send mail by means of the versatile CFMAIL tag. It shows how
valuable this tag is for the distribution of Flash Communication Server data. Before re-creating
this sample, make sure that you have configured your mail server in ColdFusion. To do so, select
Server Settings > Mail Server, and specify the IP address of the SMTP server you want to use.
About the sample
The user fills out four fields: To, From, Subject, and a message body field. When the user clicks
the Send button, the Flash Player sends a
sendMail command to the Flash Communication
Server along with the users input in the four fields as parameters. The Flash Communication
Server then calls on the Flash Remoting service to send the mail.
Re-creating the sample
The doc_sendmail.fla file provides a simple user interface for sending a mail message. The client-
side ActionScript requests the message be sent, but no result is returned to the client.
See “Creating your working environment” on page 31 before you start to re-create the sample.
To create the user interface for this sample:
1 In the Flash MX authoring environment, select File > New to open a new file.
2 From the toolbox, select the Text tool and draw four text boxes.
3 For each text box, in the Property inspector (Window > Properties), select Input Text for the
kind of text box, and type one of the following instance names:
FromText, ToText,
SubjectText, and BodyText.
4 To add the button for sending the mail, open the Components panel (Window >
Components) and drag a push button onto the Stage. In the Property inspector, give it the
instance name
Send_btn, the label Send, and the click handler sendMail.
5 Create a directory named doc_mailto in your flashcom application directory, and save the file
as doc_mailto.fla in this directory.
Przeglądanie stron 167
1 2 ... 163 164 165 166 167 168 169 170 171 172 173 ... 368 369

Komentarze do niniejszej Instrukcji

Brak uwag