9 Replies Latest reply on May 5, 2015 1:25 PM by kglad

    access a movieclip already on stage from a  child class of the document class?

    pizza&pasta

      hello!

      i have a new problem... i am trying to access MC that are already located on stage from a sub class. i  found  an explanation here  but i don't understand how to continue.

        there are three options in that example , for instance in the first option the main class has :

       

      public function Main()

              {

                  if(stage) init()

                  else addEventListener(Event.ADDED_TO_STAGE, init);

       

              }

       

              public function init(e:Event = null):void

              {  

                  var foo:Foo = new Foo(stage);

       

              }

       

      and the Foo:

        public function Foo(stage:Stage)

              {

                  if(stage) trace("success"); // output: success

       

              }//

      but where do i go from   here?