It's helpful to think of 'id' as a public getter/setter definition (which
is essentially the same as a [Bindable] public var definition) on the class
represented by the containing mxml document. So it has to follow
actionscript rules for naming a getter/setter (or variable).
You cannot write code like this in actionscript:

[Bindable]
publio var sidebar-menu:SideBarMenu;

because '-' is not permitted in a variable name, so the compiler will let
you know about that  (however '_' is permitted).

The DOM version of 'id' is coincidental here, and has different (more
lenient) rules.

For most Royale apps I don't see the need to propagate the id to the DOM.
Usually I would use className to do some custom styling.




On Fri, Feb 25, 2022 at 12:30 PM Hugo Ferreira <hferreira...@gmail.com>
wrote:

> Hi,
>
> Why does an element with dash on id (ex: id="sidebar-menu") raise an error
> while compiling ?
>

Reply via email to