Skip to main content
Participant
January 31, 2008
Question

How do caller and receiver swfs communicate

  • January 31, 2008
  • 4 replies
  • 216 views
i have a main.swf and lots of abc.swfs.An abc.swf is calling main.swf's GetUserList function with sending some parameters.
This function in main.swf would make a webservice request and would return results to abc.swf's GetUserList_CallBack function. So I need to send the movie clip and function name to the main.swf. Because there are many instances of abc.swf which are being created in run-time with different instance names.

<Code is attached>


When it enters in result event function, the object forgets its parameter values. Is this happening because of passing by values? If so what could be done for my problem?
This topic has been closed for replies.

4 replies

asilterAuthor
Participant
February 1, 2008
In GetUserList function I trace coming parameters and they are all right. If you look in GetUserList function, I set coming parameters (caller mc:MovieClip and sFunc:String) into GetUserList_Return_ListenerObject object. But GetUserList_Return_ListenerObject forgets its parameter values when it enters in result event. And if you look in GetUserList_Return_ListenerObject.result event function, those traces are undefined. GetUserList_Return_ListenerObject knows his parameter names sFunc and mc, but values are undefined.
kglad
Community Expert
Community Expert
February 1, 2008
then there should be no problem IF you use the correct path to GetUserList_CallBack.

and you can use the abc.swf target movieclip as a parameter to send to your function in main so that function knows the path to GetUserList_CallBack .
asilterAuthor
Participant
January 31, 2008
yes there are different instances of MovieClip objects. abc.swfs are loaded into these movieclips in main.swf. The function is LoadClip().
kglad
Community Expert
Community Expert
January 31, 2008
what's the relationship between abc and main? is abc loaded into a movieclip in main?