8/17/2010 3:54:46 AM
Title:
How to call a function in module from application
Hi all..
I have a tabbar with view stack in my main app where some tabs are loaded(say 3 or 4. Each tab has a module in it). When the user acts on any tab(say a button click or any event), i call the respective class which calls the server and gets the data and forms objects and sends it back to the application.
There is no problem till this phase.
Now i'm struck in as how to go to exact module which invoked this class from my application. I have to send the object that i have to a function in the module that has called the class..
can some1 help me out in this issue?
it would b better if there is a small code snippet of tabs in application and calling respective tab(module) from application.
Thanks!
8/17/2010 6:30:22 AM
I think you can use the asynchronous token in actionscript. While making a call you need to set the token which tells you which module called and on result you can check the token to know whose result is received and forward that result to concerned module.
See the example of using AsyncToken in flex with actionscript 3.0
http://askmeflash.com/qdetail/196/asynctoken-in-actionscript-3-0