4 Replies Latest reply on Feb 1, 2010 10:26 AM by Flex harUI

    Canr reference vars in parent Application

    invisibleBlade Level 1

      Hi all,

      I am building an AIR app and am having trouble getting at a var and can't see why.

       

      I have my main Application which has a Script tag in it. Within this tag I set up a var and then in my creationComplete methods I make it an instance of a custom class and send it a reference to the main app as a parameter:

      var myClass:CustomClass;

      private function init()

      {

      myClass = new CustomClass(this);

      }

       

      In myClass if I trace the parameter that is passed in i get main0 which I assume is right as my app file is called main.mxml but if I try to call methods or properties of it defined in my Script tag then I get:

      1119: Access of possibly undefined property xxxx through a reference with static type mx.core:Application

       

      My Flex / AIR experience is not much so any explanation or general pointers would be great cheers.