2 Replies Latest reply on Oct 5, 2007 7:19 AM by Newsgroup_User

    addChild() to main stage from package?

    Level 7
      Hi --

      I am trying to add a check box component to the stage via action script. I
      had this working fine inside a movie but I have moved my code to a package
      and now I am not able to use the "addChild()" function inside my package. I
      have tried creating a variable that is of type "stage" but this isn't
      working either. Any ideas on if/how this can be done?


      Thanks

      Rich


        • 1. Re: addChild() to main stage from package?
          eze_diablo Level 1
          mmm.... i think..... that maybe thjis can help you:

          main.as_______________________________________________________
          load the otheMovie.swf

          otherMovie.as___________________________________________________
          //use in the constructor

          class otherMovie{

          public function otherMovie(){
          this.addEventListener(Event.ADDED_TO_STAGE, setup);
          }

          private function setup():void{
          //your code
          }

          }
          • 2. Re: addChild() to main stage from package?
            Level 7
            Hi --

            I'm not sure how to interpret your pseudo code here.

            I have actions on the first frame of the main movie which call my custom
            package. From inside the package I want to refer to the "root" stage.

            Rich

            "eze_diablo" <webforumsuser@macromedia.com> wrote in message
            news:fe4d3d$2c4$1@forums.macromedia.com...
            > mmm.... i think..... that maybe thjis can help you:
            >
            > main.as_______________________________________________________
            > load the otheMovie.swf
            >
            > otherMovie.as___________________________________________________
            > //use in the constructor
            >
            > class otherMovie{
            >
            > public function otherMovie(){
            > this.addEventListener(Event.ADDED_TO_STAGE, setup);
            > }
            >
            > private function setup():void{
            > //your code
            > }
            >
            > }
            >