2 Replies Latest reply on Jul 28, 2008 1:45 AM by dam85

    ADD new component

    dam85
      Hello,
      i added new namespace xmlns:my="design.*"
      how can i addChild (child of the new namescape) in an actionscript file?

      thanks
        • 1. Re: ADD new component
          Level 7

          "dam85" <webforumsuser@macromedia.com> wrote in message
          news:g6he3k$fd4$1@forums.macromedia.com...
          > Hello,
          > i added new namespace xmlns:my="design.*"
          > how can i addChild (child of the new namescape) in an actionscript file?

          You only need the namespace for things you are adding in MXML. For adding
          things in as, you need something like:

          import design.*;

          private var myChild:DesignChild;//you'd use the actual name of your class as
          the type

          private function addDesignChild():void{
          myChild = new DesignChild();
          //set child position, properties before adding
          myChild.x = 10;
          myChild.y=10;
          myChild.color=0xFF0000;//red
          addChild(myChild);
          }

          HTH;

          Amy


          • 2. Re: ADD new component
            dam85 Level 1
            thank you very much