{"id":40,"date":"2010-01-04T23:39:20","date_gmt":"2010-01-05T05:39:20","guid":{"rendered":"http:\/\/steven.diomampo.com\/blog\/?p=40"},"modified":"2010-02-06T14:20:02","modified_gmt":"2010-02-06T20:20:02","slug":"custom-events-robotlegs-dispatch-overriding-the-clone-method","status":"publish","type":"post","link":"https:\/\/steven.diomampo.com\/blog\/2010\/01\/04\/custom-events-robotlegs-dispatch-overriding-the-clone-method\/","title":{"rendered":"Custom Events + Robotlegs + dispatch + Overriding the clone() method"},"content":{"rendered":"<p><em>Let me preface this by saying, this approach is certainly not the final say. Any tutorials, demos or information shared on my site should be taken for what they are worth. I love feedback, so feel free to leave a comment below.<\/em><\/p>\n<p><span style=\"color: #008000;\"><strong>[Update: As Amy mentioned in the comments, this is not specific to the Robotlegs framework.]<\/strong><\/span><\/p>\n<p>I have recently been tinkering with the new Robotlegs framework and wanted to share a quick gotcha. It&#8217;s really not a gotcha, and really more something I forgot to do. <a href=\"http:\/\/www.tink.ws\/blog\/custom-events-in-as-30-dont-forget-to-override-the-clone-method\/\" target=\"_blank\">Click here<\/a> to see the post that helped jog my memory on this one. Hope this will come in handy for someone.<\/p>\n<p><a title=\"View Demo\" href=\"http:\/\/steven.diomampo.com\/demos\/robotlegs-customevent\/Main.html\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52\" title=\"Screen shot 2010-01-05 at 12.03.29 AM\" src=\"http:\/\/steven.diomampo.com\/blog\/wp-content\/uploads\/2010\/01\/Screen-shot-2010-01-05-at-12.03.29-AM.png\" alt=\"\" width=\"540\" height=\"328\" srcset=\"https:\/\/steven.diomampo.com\/blog\/wp-content\/uploads\/2010\/01\/Screen-shot-2010-01-05-at-12.03.29-AM.png 540w, https:\/\/steven.diomampo.com\/blog\/wp-content\/uploads\/2010\/01\/Screen-shot-2010-01-05-at-12.03.29-AM-300x182.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<p><a title=\"Demo\" href=\"http:\/\/steven.diomampo.com\/demos\/robotlegs-customevent\/Main.html\" target=\"_blank\">View Demo<\/a> | <a title=\"Source\" href=\"http:\/\/steven.diomampo.com\/demos\/robotlegs-customevent\/srcview\/index.html\" target=\"_blank\">View Source<\/a><\/p>\n<p>If you can&#8217;t read the white print on the demo it says:<\/p>\n<div id=\"_mcePaste\"><em>This demo serves to explain the need for overriding the clone() method on custom events.<\/em><\/div>\n<div><em><br \/>\n<\/em><\/div>\n<div id=\"_mcePaste\"><em>Notice that no output is generated when a user clicks the CustomEventOne button.<\/em><\/div>\n<div><em><br \/>\n<\/em><\/div>\n<div id=\"_mcePaste\"><em>When a user clicks CustomEventTwo, the output is generated. This is because the MainMediator must re-dispatch the custom event, and so the developer must remember to Override the clone() method.<\/em><\/div>\n<div><em><br \/>\n<\/em><\/div>\n<div id=\"_mcePaste\"><em>Right-Click to View Source, then look in the com.diomampo.rlcustomeventdemo.events package at the differences between both events.<\/em><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Let me preface this by saying, this approach is certainly not the final say. Any tutorials, demos or information shared on my site should be taken for what they are worth. I love feedback, so feel free to leave a comment below. [Update: As Amy mentioned in the comments, this is not specific to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3,9],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-flash-flex-actionscript3","category-tutorials"],"_links":{"self":[{"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":18,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions\/49"}],"wp:attachment":[{"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/steven.diomampo.com\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}