Welcome, Guest. Please login or register.
Did you miss your activation email?
02/09/12, 03:06
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  NetServicesTrace Message
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: NetServicesTrace Message  (Read 4605 times)
Chaz W
Server what's that
*
Posts: 37



View Profile WWW Email
« on: 04/18/05, 09:06 »

Hello,

I do not know if this posting should go here, but I’m receiving this message:

NetServicesTrace - GetDirectorListForCostCenter_Result was received from server: [object Object]"

CallRemoteAccess("GetDirectorListForCostCenter"); this return the results


function CallRemoteAccess(WhichCallFunction)
{
  //this pass which function throw the error//
  strFunctionCall = WhichCallFunction;
//trace("strFunctionCall: "+strFunctionCall)
switch(WhichCallFunction)
 {
  …
   case "GetDirectorListForCostCenter":
    if(numStringPos == undefined)
    {
      strSelectCostCenter = "XXXXXXXXXX";
      numStringPos = 2
     };//End of if(numStringPos == undefined)
    CallFunction.GetDirectorListForCostCenter(strSelectCostCenter,numStringPos);
    break;
 …
 };//End of switch(WhichCallFunction)
};//End of function CallRemoteAccess(WhichCallFunction)
//*** End Program Call Remote Access ***//

function GetDirectorListForCostCenter_Result(result)
{
  rsDirectorList_rs = result;

  if(rsDirectorList_rs.isFullyPopulated())
  {
   dsDirectorData_ds.items    = rsDirectorList_rs;
   numRecordCountDirector     = "Total Director: " +rsDirectorList_rs.getLength();
   strDisplayFirstMonth       = rsDirectorList_rs.getItemAt(0).Month10;
   strDisplaySecondMonth      = rsDirectorList_rs.getItemAt(0).Month11;
   strDisplayThirdMonth       = rsDirectorList_rs.getItemAt(0).Month12;
   strDisplayProgressionStep  = "Step Action & Notes";

   LoadScreen("ShowDirectorList");
  };//End of if(rsDirectorList_rs.isFullyPopulated())
};//End of function GetDirectorListForCostCenter_Result(result)

var ReceivingFunctionFromFlashFile_lc:LocalConnection = new LocalConnection();
ReceivingFunctionFromFlashFile_lc.FunctionToExecute = function(strReceivingCostCenter:String,numReceivingStringPos)
{
  LoadScreen();
  strSelectCostCenter = strReceivingCostCenter;
  numStringPos        = numReceivingStringPos;

  CallRemoteAccess("GetDirectorListForCostCenter"); get the message does not return the results
};//End of ReceivingFunctionFromFlashFile_lc.FunctionToExecute = function(strReceivingCostCenter:String,numReceivingStringPos)
ReceivingFunctionFromFlashFile_lc.connect("PassingToDirector");

How do I fix this?

Thanks

Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 04/18/05, 10:02 »

This is usually the message that Remoting output when you don't write the handler function. I see you're using LocalConnection, that usually call a function in another movie, and that you have a handler function. Are you using LocalConnection or Remoting? What about this CallRemoteAccess function? Usually this happns when the handler function is not in the same scope as the connection.

Jorge
Logged

Chaz W
Server what's that
*
Posts: 37



View Profile WWW Email
« Reply #2 on: 04/18/05, 10:37 »

This is usually the message that Remoting output when you don't write the handler function.

I see you're using LocalConnection, that usually call a function in another movie and that you have a handler function.
This LocalConnection is receiving the command from the calling movie which is in loader component one.

Are you using LocalConnection or Remoting? Both
 
What about this CallRemoteAccess function? This is an area were I have all my remote calls.

Usually this happns when the handler function is not in the same scope as the connection.

Let me tell you about the application

LoginScreen fla – after the user is verified it tells which datagrids to load
MainMovie fla – this movie have four loader components it receives commands from the LoginScreen fla to display how many loader components to display and which datagrid fla to show.

Datagrid01 fla – this have a datagrid and call a function and the other 3 movies after a row is selected.

Datagrid02 fla – this have a datagrid, receives a command from Datagrid01 fla and call a function and the other 2 movies after a row is selected.

Datagrid03 fla – this have a datagrid, receives a command from Datagrid01 fla  and call a function and the other Datagrid04 fla movies after a row is selected.

Datagrid04 fla – this have a datagrid and receives a command from Datagrid01 fla.
 


I hope this can help you understand my needs

Thanks
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #3 on: 04/18/05, 10:55 »

Quote
What about this CallRemoteAccess function? This is an area were I have all my remote calls.

So move your handler to this area to match NetConnection scope.

Jorge
Logged

Chaz W
Server what's that
*
Posts: 37



View Profile WWW Email
« Reply #4 on: 04/18/05, 11:15 »

My datagrids movies have the following includes:

//*** Begin Include Area ***//
#include "AccountabilityRemoteConnection.as"
//*** End Include Area ***//

does this match my NetConnection scope by using this include AccountabilityRemoteConnection.as

My handler calls this function

var ReceivingFunctionFromFlashFile_lc:LocalConnection = new LocalConnection();
ReceivingFunctionFromFlashFile_lc.FunctionToExecute = function(strReceivingCostCenter:String,numReceivingStringPos)
{
   LoadScreen();
   strSelectCostCenter = strReceivingCostCenter;
   numStringPos        = numReceivingStringPos;

   CallRemoteAccess("GetDirectorListForCostCenter");
};//End of ReceivingFunctionFromFlashFile_lc.FunctionToExecute = function(strReceivingCostCenter:String,numReceivingStringPos)
ReceivingFunctionFromFlashFile_lc.connect("PassingToDirector");

I only get this message in movie datagrid02 fla

When I start the movie and setup the scenario to display three loader and the datagrid01 fla, datagrid02 fla and datagrid03 fla everything loads fine and when I click on the row in movie datagrid01 the other two movies loads and  I can see the new results in movie datagrid03, but nothing loads for movie datagrid02 and the code is the same other then the uniqueness, also when I use movie datagrid01 datagrid02 and datagrid03 without the MainMovie it works fine.


Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #5 on: 04/18/05, 12:28 »

All Remoting results comes to the timeline where you create the NetConnection. You can manage from there to populate all your components (recomended) or can create new NetConnections on each movie.

Jorge
Logged

Chaz W
Server what's that
*
Posts: 37



View Profile WWW Email
« Reply #6 on: 04/18/05, 13:27 »

I’ve tried both of these options and I am getting the same results.

What makes this so puzzling is the results comeback and display in movie datagrid03, but not datagrid02.

I know that I am call the right function of the remoting because I put a trace in the code, but the result does not comeback to the handler were the call is made from.

Maybe you can look at the code. Another set of eyes might see something that I am overlooking.

Thanks

Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #7 on: 04/18/05, 15:00 »

Sorry, tons of my own code to debug. Usually debug proccess is like that:

- Create the NetConnection
- Call the method
- Trace inside the handler to see if results are coming back (the NetConnection Debugger help on this) If the result is not coming back, then some error should appear in the netConnection debugger.

Now call server-answer server is working fine. Then:

- Check if desired components are in the rigth target (even you can populate manually to check)
- if the path between the onresult handler and the datagrid is rigth, then your datagrid should be populated.

When building different movies, sometimes devs creates NetConnections in each movie, or have reference to _root that should be corrected when all comes togheter. This kind of errors are closed related to the movie structure, and is hard to check.

Jorge

Logged

Chaz W
Server what's that
*
Posts: 37



View Profile WWW Email
« Reply #8 on: 04/21/05, 12:15 »

Thanks for you help.

I got it to work by reloading the loader.

Thanks
P.S. how do I close this posting?
Logged
worthyashs
Server what's that
*
Posts: 3


View Profile Email
« Reply #9 on: 12/19/05, 08:16 »

Hi,

I've got this problem too with getting the response NetServicesTrace in the debugger.  I understand that it's not finding the handler and is displaying this message so I know that it is looking for a result handler.

My problem is working out where to put the result handler.  I have five movies, a base container swf, a login swf and then the rest of the applications movies that are split into individual parts of the application.  I.E. One loads in data, one displays and manipulates it.  I've done it this way to stop the problem of having one massive file that tries to do everything.

The login component connects to Remotingn and I've used Jorge's method of declairing the service calls gloabally.  Further remoting functions are called in the subsequent movies.  The functions are all working correctly and populating the database.  The Result functions don't work and I can't figure out why.  I've tried declairing them in all of my movies and they don't work.

Please HEEEEELLLLLPPPP!!  It's driving me mad because if the functions are working from the subsequent movies then why aren't the Results?Huh?

I guess I just don't understand scope enough.

Thanks for any and all help and have a Great Christmas

Tim
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #10 on: 12/19/05, 09:47 »

Usually the service look for the handler in the same scope where you declare the connection, so if you declare it in _root, write the handler in _root

Jorge
Logged

worthyashs
Server what's that
*
Posts: 3


View Profile Email
« Reply #11 on: 12/19/05, 10:32 »

Hi,

Thanks for the reply and also thanks for your tutorials on AMFPHP they have been tremendosly helpful.

Here's the code I'm using to connect.  I thought it might be something to be with declairing in the root - but as you can see I've decliared the service call in _global and assume that this will make the service call available to everything.

NetServices.setDefaultGatewayUrl("http://webdev2:8080/flashservices/gateway.php");
//variable fo the net service gateway connection
conn = NetServices.createGatewayConnection();
//Global service call, required before all functions held in the php script
_global.svc = conn.getService("login_chartists", this);
_global.svcChart = conn.getService ("chart_chartists", this);

Am I missing something really basic?

Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #12 on: 12/19/05, 11:28 »

The service is available from everywhere, but the handler should be where you declare the _global.svc, that means, in the same timeline

Jorge
Logged

worthyashs
Server what's that
*
Posts: 3


View Profile Email
« Reply #13 on: 12/19/05, 11:48 »

Thanks for the help - managed to fix the prob.

Changed the code to

_global.svcChart = conn.getService ("chart_chartists", _root);

Decliring the service call in the root rather than this makes it available everywhere and mappable to.

Now the Result function is

_root.functionName_Result = function () {
}

There's probably a better way to do this, but hey - IT WORKS.

Thanks for putting me on the right lines.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything