0 Replies Latest reply on Mar 23, 2012 4:09 PM by 5Systems

    button skin not showing up with addElement();

    5Systems

      I created a class in actionscritpt that extends the spark.components.Button, as i will be loading a bunch of buttons at runtime. I have a SkinnableContainer.mxml file that the spark buttons will be loaded into. When i use the addElement() method within that mxml file like so my custom skin does not show.

      public function displayButton(button:Button):void
      {
           addElement(button);
      }
      

       

      however if in that same SkinnableContainer.mxml file I drop it in via

      <mybuttons:CustomButton x="73" y="4"/>
      

       

      the skin shows just fine. 

       

      Any ideas?