u can extends the event,add a source attribute to it
eg:

public class SourceEvent extends CairngormEvent{

     public SourceEvent(type:String,source:Object){
         super(type);
         this.source=source ;
      }
      public var source:Object;
}

then inner the viewHelper:

public function getResults():void {
    var event:SourceEvent=new SourceEvent("askForResult",this.view);
    dispatchEvent(event);
}


last,the command is knowed the events.source now!

    event.source.setResult...
2006/2/17, Alberto Albericio Salvador < [EMAIL PROTECTED]>:
Hi all,

In Cairngorm commands, I always define statically where I want "some
results" to be sent (normally a custom function in component that
extends ViewHelper). This updates my view and works fine. But...

How can I make that command Class to send "some results" to whatever
asked for them (who dispatched the event that threw that command)?

Eg:

foobar1.mxml and foobar2.mxml
..
public function setResults(someResults):void {
    //update my controls
}

public function getResults():void {
    dispatchEvent("askForResults");
}
....

foobar1 and foobar2 dispatch the same event and the command needs to
know where to send back the results and run setResults on the
corresponding caller. How can I achieve this?

Thanks in advance


--
Alberto Albericio Salvador
Aura S.A. Seguros
Departamento Informática



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
闲云孤鹤 - 清冷香中抱膝吟

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to