6 Replies Latest reply on Dec 5, 2011 4:10 AM by archemedia

    Add custom property to MXML component without extending

    Francisc Level 3



      I want to add a custom property to a bunch of Spark buttons.

      Much like the HTML5 data-* feature.


      Is that possible without extending the Spark Button class?

      I tried using the id and setting it to be a public static const from an AS class, but it doesn't allow compile time ID names in MXML. (e.g. <s:Button id={SomeClass.aStaticConst}/>)

      I could create the buttons in AS3 and this be allowed to set IDs like described above, the way its setup is to allow other people to add new elements in MXML for ease of use so I'd rather keep it so.