MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Especificaciones Pagina 167

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 369
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 166
Application Server Connectivity 89
8 For each test, receive the result, result. Then call the client-defined function postResults
and pass the client the
result data.
// Get result of Boolean test and pass the result to the
// client with a call to postResults
TestResult.prototype.getBoolean_Result = function(result)
{
trace("***** getBoolean_Result: " + result);
this.client.call("postResults", null, result);
}
// Get result of addition test and pass the result to the
// client with a call to postResults
TestResult.prototype.addNumbers_Result = function(result) {
trace("***** addNumbers_Result: " + result);
this.client.call("postResults", null, result);
}
// Get the array and pass it back to the client
// with a call to postResults
TestResult.prototype.getArray_Result = function(result) {
trace("***** getArray_Result: " + result);
this.client.call("postResults", null, result);
}
Note: In the samples in this chapter, you subscribe to the remoting service by including netservices.asc in your
main.asc file. You need to provide a result method to handle any result value coming back from the remoting
service in the main.asc file as well. The samples in this chapter use the [methodName]_Result callback
convention from Flash Remoting. For example, for the call to getBoolean, you provide a call back to the
getBoolean_Result method.
9 Save the file as main.asc in a doc_remoting directory under the flashcom applications
directory.
Note: Save this main.asc file where you’ve chosen to store your server-side application files. For more
information see Chapter 1, “The flashcom application directory,” on page 15.
To write the ColdFusion component for this sample:
1 Using your standard editor, create a new file and add code to name the application and indicate
how to access it.
<cfcomponent name="simple" access="remote">
2
Create the addNumbers method that the Flash Communication Server will invoke.
<cffunction name="addNumbers" output="false"
description ="add two numbers" access="remote">
<cfargument name="num1" required="true" type="numeric"
description="the first number">
<cfargument name="num2" required="true" type="numeric"
description="the second number">
<cfreturn num1+num2>
</cffunction>
3
Create the getBoolean method that the Flash Communication Server will invoke.
<cffunction name="getBoolean" output="false" description="Returns a
boolean that you specify." access="remote">
<cfargument name="bool" required="true" type="boolean" description="The
boolean to return">
<cfreturn bool>
</cffunction>
Vista de pagina 166
1 2 ... 162 163 164 165 166 167 168 169 170 171 172 ... 368 369

Comentarios a estos manuales

Sin comentarios