{"id":183,"date":"2008-11-25T23:41:32","date_gmt":"2008-11-26T07:41:32","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=183"},"modified":"2008-11-25T23:41:32","modified_gmt":"2008-11-26T07:41:32","slug":"the-id-attribute-in-41","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2008\/11\/25\/the-id-attribute-in-41\/","title":{"rendered":"The id Attribute in 4.1"},"content":{"rendered":"<p>One subtle thing that has changed in OpenLaszlo 4.1 is that you can no longer specify the id attribute when instantiating objects from script.<\/p>\n<p>When instantiating a class from script, you can specify a dictionary of initial properties as the second argument to the constructor:<\/p>\n<p><code>var v = new lz.view(canvas, {width: 300, height: 300, bgcolor: 0xff0000}); \/\/ 4.1<\/code><\/p>\n<p>Prior to OpenLaszlo 4.1, the constructor shown above would have been LzView() instead of lz.view(). Also, prior to 4.1, you could have specified the id attribute in addition to the width, height, and bgcolor attributes, and then referenced your newly-created view by that id later in the application. e.g.<\/p>\n<p><code>var v = new LzView(canvas, {id: \"myNewView\", width: 300, height: 300, bgcolor: 0xff0000}); \/\/ 4.0.12<\/code><\/p>\n<p>Since the SWF9 does not allow global variables to be created on-the-fly, OpenLaszlo 4.1 will no longer allow you to do this either. For better or for worse.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>One subtle thing that has changed in OpenLaszlo 4.1 is that you can no longer specify the id attribute when instantiating objects from script. When instantiating a class from script, you can specify a dictionary of initial properties as the second argument to the constructor: var v = new lz.view(canvas, {width: 300, height: 300, bgcolor: &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2008\/11\/25\/the-id-attribute-in-41\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The id Attribute in 4.1<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/183"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":3,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/186"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}