I always treat events as asynchronous - I don't see how else you can deal with them. I'll have to check out the cookbook article..
Paul ----- Original Message ----- From: "Dan" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, October 16, 2008 4:03 PM Subject: [flexcoders] newbie question on synchronous and asynchronous events > From Flex cookbook beta on adobe.com, "How to handle events in a > TestCase?" article: > "Testing behavior in a TestCase often involves waiting for > asynchronous events. If the TestCase methods only concern synchronous > events like property change events fired immediately when the property > is set, no special handling is required. It is only when asynchronous > events are involved that extra care needs to be taken. A common > example would be waiting for a URLLoad to finish or a UIComponent to > finish creation." > > My question is: How do I distinguish between the synchronous and > asynchronous events? > From what is said, if the event is synchronous, then I could test for > event effect in synchronous manner. For example: > > public function testSync(){ > this.myValue = 0 > addEventListener(MySynch.Sync, listener) > dispatchEvent(new MySynch) > assertEquals (this.myValue, 10) > } > > public function listener(){ > this.myValue = 10 > } > > > Now, if I write the code for WebService send, test code would not > work. Am I getting this right? If so, how do I distinguish between the > synchronous and asynchronous events? > > Thanks, > > Dan > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > >

