5 Replies Latest reply on Jan 13, 2010 12:38 PM by Flex harUI

    Access to main of an actionscript project

    Agenore990

      how can I accesso to the main class of my application from another class? exemple:

       

       

      I have some components in the main class ( Canvas, labe,..... ) and I would access the through a class I defined before.

       

      package {

           import Mappa.Genera_mappa;

           

           import flash.display.Sprite;

           public class Main extends Sprite

           {

                

                public var mappa:Genera_mappa;

                

      public function Main()

                {

                     

                     mappa = new Genera_mappa();

                     

                     stage.addChild(mappa.genera());

                     

                     

                }

           }

      }

       

      I have to access to a variable in mappa:Genera_mappa from another class.

       

      How can I do?

       

      Thanks very much and sorry for my English!