tag:blogger.com,1999:blog-2105870033801572606.post6418417182288685822..comments2024-02-16T03:13:32.272-06:00Comments on Art's Flex Notes: Quick Dive into Parsley (Messaging with Flex Events Example - Part 5)Arthttp://www.blogger.com/profile/02704202971467350834noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2105870033801572606.post-9658589780959381762010-12-10T12:33:23.553-06:002010-12-10T12:33:23.553-06:00If you copied and pasted your code, then the issue...If you copied and pasted your code, then the issue is with ManagedEvents tag, it should be plural not singular. <br /><br />It should be:<br />[ManagedEvents("DueInEvent")]Arthttps://www.blogger.com/profile/02704202971467350834noreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-12457421320309490282010-12-10T10:18:09.553-06:002010-12-10T10:18:09.553-06:00I have a
* Main.mxml
* DueInEvent.as
* DueInContr...I have a <br />* Main.mxml<br />* DueInEvent.as<br />* DueInController.as<br /><br />in Main:<br /><br />[Event(name="DueInEvent", type="mifield.events.DueInEvent")]<br />[ManagedEvent("DueInEvent")]<br /><br /><br /><br /><![CDATA[<br />protected function getDueInData(event:Event):void<br />{<br /> dispatchEvent(new DueInEvent(DueInEvent.DUE_IN_DATA_RQST));<br />}<br />...<br />-------------------------------------------<br />In event:<br />I have all the right stuff... with clone override<br />-------------------------------------------<br />In Controller<br />[MessageHandler]<br />public function handleDueInServiceDataRqst(message:DueInEvent):void<br />{<br /> if (message.type == DueInEvent.DUE_IN_DATA_RQST) {<br /> trace("Controller: due-in data requested.");<br /> service.getData(); // a svc call<br /> }<br />}<br />...<br />...<br />-------------------------------------------<br /><br />However, the event is not getting handled<br />Now in Main.mxml if I call the <br /><br />[MessageDipatcher]<br />public var dispatcher:Function<br /><br />protected function getDueInData(event:Event):void<br />{<br /> dispatcher(new DueInEvent(DueInEvent.DUE_IN_DATA_RQST));<br />}<br /><br />Then everything works...can you say why ?Aphtkhttp://aphatak.blogspot.comnoreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-52730190301731041192010-12-02T14:31:23.671-06:002010-12-02T14:31:23.671-06:00Thanks for the explanation, added to the one on th...Thanks for the explanation, added to the one on the previous note, it's all clear.Jahznoreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-72950301795502038412010-12-01T19:43:48.828-06:002010-12-01T19:43:48.828-06:00Well, like most things, it's a matter a which ...Well, like most things, it's a matter a which you like best. I like Parsley messaging better, keeping in mind that it is synchronous and if I daisy chain to many things together the application may loose responsiveness.<br /><br />Why do I like Parsley messaging over Flex Events? Because it doesn't depend on Event types bases on string identifiers. I get type checking by the compiler by default, and refactoring is much easier. Also there is a lot less boilerplate code.<br /><br />Why use Flex Events? It makes it easier to take Parsley out your application if you choose to do so in the future. They are asynchronous.Arthttps://www.blogger.com/profile/02704202971467350834noreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-87780452977486654552010-12-01T16:12:08.664-06:002010-12-01T16:12:08.664-06:00Working great like previous one without Flex event...Working great like previous one without Flex events.<br /><br />Still, I'm not sure about what should drive the decision about going for a Flex Event or not.<br />Inregards to this small example, they just seem to achieve the same thing, with some minor differences on how to program it, but what's the real difference ? What are the key points to remember when making this decision ?<br /><br />Cheers!Jahznoreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-90235573893843223652010-09-23T05:24:18.821-06:002010-09-23T05:24:18.821-06:00Sorry it's taking so long for the new post. I...Sorry it's taking so long for the new post. It's almost ready.Arthttps://www.blogger.com/profile/02704202971467350834noreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-91970332490175351622010-09-21T17:53:36.528-06:002010-09-21T17:53:36.528-06:00Thank you so much. I like your simple way of expla...Thank you so much. I like your simple way of explaining things. Keep up your great job. <br />Yes I would be very interested to learn more about the Nested Context and Object life cycle.Anonymoushttps://www.blogger.com/profile/03385671457365996962noreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-54598376574792374532010-09-16T09:50:51.108-06:002010-09-16T09:50:51.108-06:00Thanks. Yes there are more on the way. I'm j...Thanks. Yes there are more on the way. I'm just finishing one on Nested Context and Object life-cycle.<br />I work on these at home when the family is sleeping, so it goes a bit slower than I would like but it will continue. Already have 3 inline.<br /><br />Also noted your example at: <br />http://www.lonhosford.com/lonblog/2010/09/14/basic-parsley-framework-flex-example-explained/<br />which is great, it combines in a simple case, what I have posted here. It also includes the [Init] tag which I go into in the next example.<br /><br />My goal is to keep the simplicity, focus on Parsley and not on building a cool gadget app. to make things a lot simpler to follow.Arthttps://www.blogger.com/profile/02704202971467350834noreply@blogger.comtag:blogger.com,1999:blog-2105870033801572606.post-30202101276424673302010-09-15T09:28:07.287-06:002010-09-15T09:28:07.287-06:00Very nice explanations. Hope you do more and keep...Very nice explanations. Hope you do more and keep the simplicity.Lon Hosfordhttps://www.blogger.com/profile/16819236543087143154noreply@blogger.com