MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Use Manual page 131

Using flash remoting for flash mx 2004 actionscript 2.0
Table of Contents

Advertisement

Looking at the ActionScript code that calls the EJB
The following code is the ActionScript of the example Flash application:
// Import Flash Remoting files
import mx.remoting.Service;
import mx.remoting.debug.NetDebug
// --------------------------------------------------
// Start up the application
// --------------------------------------------------
function ejbLoan_init(){
flashstatelessHome = new Service(
"http://localhost/flashservices/gateway",
null,
"SampleLoanEJBHome",
null,
null);
pc:PendingCall = flashstatelessHome.create();
pc.responder = new RelayResponder(this, "create_Result", "create_Fault");
}
// ---------------------------------------------------
// Business Methods
// ---------------------------------------------------
// Calculate payment based on data user enters in principalInput,
// monthsInput, and rateInput text fields. Function arguments must
// be numbers. Java method expects double, int, and float.
function calculate()
{
flashStatelessEJB.calculate( (number (principalInput.text)),
(number (monthsInput.text)), (number (rateInput.text)) );
}
// --------------------------------------------------
// Handlers for data coming in from server
// --------------------------------------------------
// Get reference to EJBObject and invoke calculatePayment function.
function create_Result( result:ResultEvent ):Void
{
flashStatelessEJB = result;
calculate();
}
// Get reference to calculate result object and display result
// in PayOutput text field.
function calculate_Result (result:ResultEvent):Void
{
payOutput.text = result;
}
Calling Enterprise JavaBeans (EJBs) from Flash
131

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash remoting mx

Table of Contents