3 Replies Latest reply: Jun 4, 2010 6:47 AM by kglad RSS

    adding multiple items

    Smitch1581 MeganK

      Hi all, sorry if this is a very straight forward question but hows the best way to add multiple items from the library?

       

      I have entered the following code and both items do import, but i cant control the label of the second library item called "Cool"

       

      After doing some digging, i think i found out the class name of the second object was called "Cool" and the base class was "import flash.display.SimpleButton;" so it looked like i had to import that class at the top like i did! But still not working. and still no joy!

       

      I think i need to add in "public class Cool extends SimpleButton" so it inherits the SimpleButton class after the first public class and then create a new function called "public function Cool() " and then add the function body but when i go to do that it all goes wrong. Am i on the right track or am i missing a trick!!

       

      Any help would be greatly appreciated?! ;-)

       

      package

      {

      import flash.display.Sprite;

      import fl.controls.Button;

      import flash.display.SimpleButton;

       

      public class TestBench extends Sprite

       

      {

      private var Sean:Button;

      private var Kelly:Cool;

       

      public function TestBench ()

      {

       

      Sean=new Button();

      Sean.label="Sean Mitchell";

      Sean.x= 250, Sean.y=250;

      addChild(Sean);

       

      Kelly=new Cool();

      Kelly.label="Hi";

      Kelly.x= 82, Kelly.y=38;

      addChild(Kelly);

       

      }

       

      }

      }