Search code examples
actionscript-3mxmlapache-royale

What's the difference between id and localId in Apache Royale?


In Apache Royale we can identify objects with "id" and "localId" properties. The problem is to know why we have two ways of doing the same apparently.


Solution

  • I found the Answer and sharing solution:

    HTML requires ID's that are unique, so by creating Royale components that internally use ID's to identify the inner sub-components this means the same ID will be used in all instances created and therefore generating a problem of lack of uniqueness.

    Solution:
    Use "localId" in the inner components, so Royale will use it internally and will avoid to add "id" when you transpile to HTML.