Hi,
right there is a small difference here from Flash to HTML5 - the local scope itself is working, but access to local scope attributes is only possible when the attributes are already existing. In Flash the layer event attributes like onclick, ondown, onup, ... are already predefined (with null as initial value), but in HTML5 (currently) not. There these attributes will be created first when setting them in the xml.
As workaround you could add an onclick="" to the <layer> xml, then attribute will be defined and the code will work in HTML5 too.
This will be fixed in the next release. Then the HTML5 version will behave like the Flash version.
Best regards,
Klaus