Hi,
I'm trying to finish a tutorial on Flash Remoting but the examples I have are
from Flash MX, and I'm using Flash 8 Pro.
I've tried using this syntax;
<--- CODE ---->
var nameVal = "New Model";
var descVal = "The latest seat inovation.";
var priceVal ="21.45";
var typeVal = "3";
insertData = function(){
var insertPc:PendingCall =
connect_conn.insertPart(nameVal,descVal,Number(priceVal),Number(typeVal));
insertPc.responder = new
RelayResponder(this,"insertPart_result","insertPart_Fault");
}
function insertPart_result(itemNumber){
trace("the data was loaded into the database");
trace("the new part number is "+itemNumber);
}
function insertPart_Fault(){
trace("an error has occurred inserting data into the Database");
}
insert_btn.addEventListener("click",insertData);
<--- CODE ---->
The data shows up in the database, but insertPart_result() never gets called.
When I take the service call out of the function, it works fine.
I've tried putting the insertPart_result and insertPart_Fault in the
insertData function with no change.
Can anyone see the problem here?
thanks for your help,
- J
jag57 - 16 May 2006 22:25 GMT
Hmm, it seems you are having a problem on the server side because I can't see
anything wrong with your code. Have you tried using the NetConnection Debugger
yet? To use that:
1. Windows > Common Libraries > Remoting
2. Drag the RemotingDebugClasses component to the stage
3. Write this code:
import mx.remoting.debug.NetDebug;
NetDebug.initialize();
4. Open the debugger: Window > Other Panels > NetConnection Debugger
5. Run your flash movie and watch the debugger for errors.
Also, have you tried looking in the Flash help? Hit F1 in the program and
look in the book: Using Flash Remoting MX 2004 > Using Flash Remoting
Actionscript > Calling service functions > Calling service functions overview