Hello World:

I have a big problem. I hope that you may help me =[

* Well, i´m working with adobe Flex 3 and  flex Builder.
* When i need data stored in database, i use web services.

* Then i have a class that manipulate call and reception of
information delivered by web services: manipulateWS.as
* when data arrives i launch event for alert to form that need it.

* Each form has its own class manipulate.as ....
* Many forms can call to the same method (ej: loadCountry of class
manipulateWS.as)

* when the forms ask data, call manipulateWs.as's method and when data
arrive it listen event.

Although each form has its own class manipulateWS.as, all listen when
the data arrive, even when it dont call it.
Then the form does incorrect things, because it listen event for other
form.....


Finally my question is: How can i avoid this situation? How does event
know who call it ? or How does event know whom answer it?


Thank you in advance.....
greetings!!!



Here is part of code, for you understand better my problem....


 **********************************************************
*********           manipulateWS.as          ***************
 **********************************************************

//register listener of web service's method
ws.loadCountry.addEventListener(ResultEvent.RESULT,
resultLoadCountry);

//method for ask for information:
  public function loadCountry(idCountry:int):void
   ws.loadCountry(idCountry);

//method for manipulate the results:
  private function resultLoadCountry(event:ResultEvent):void
{

   //when data arrive... i launch a event for alert that information
is here
   var ev:ResultMethodWSEvent;
   ev = new ResultMethodWSEvent("resultLoadCountry",true, "");

   dispatchEvent(ev);
}

*************************************************************************
The class ResultMethodWSEvent.as extends of event, and it need:
- str_nameMethod: the name of method->  resultLoadCountry
- if result Ok or not -> true or false
- aditional data
(optional)

*************************************************************************

 **********************************************************
*********           FormX.mxml               ***************
 **********************************************************
//register listeners:
my_managerWS.addEventListener(ResultMethodWSEvent.RESULTADOWS,
manipulateResultMethodWS);

//manipulating event:
private function manipulateResultMethodWS(ev:ResultMethodWSEvent):void
{
    switch(ev.str_nameMethodWS)
    {
        case 'resultLoadCountry': //do things...
    }
}

//when i need information:
my_managerWS.loadCountry(idCountry);



 **********************************************************
*********           FormY.mxml               ***************
 **********************************************************
//register listeners:
my_managerWS.addEventListener(ResultMethodWSEvent.RESULTADOWS,
manipulateResultMethodWS);

//manipulating event:
private function manipulateResultMethodWS(ev:ResultMethodWSEvent):void
{
    switch(ev.str_nameMethodWS)
    {
        case 'resultLoadCountry': //do  OTHERS things...
    }
}
//when i need information:
my_managerWS.loadCountry(idCountry);

*****************************************************************


--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com
Para sair da lista, envie um email em branco para 
flexdev-unsubscr...@googlegroups.com
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---

Responder a