0 Replies Latest reply on Jan 11, 2007 2:34 AM by MarcoBazza

    How to set an icon of a Button in ActionScript ?

    MarcoBazza
      A need to create at runtime some buttons and set their icons.
      I found a problem to do that in ActionScript. In MXML is easy to set the icon just use a syntax like this: <mx:Button label="some text" icon="images/ok.png"/>

      But in ActionScript how I can set the icon ?
      I need to create the icon by a path passed as a parameter.

      Example:
      The user want to create a button with a label and an icon so call a method like this (that return and instance of Button): createButton("Update","images/update.png");

      Thank at all for the help.
      Marco