1 Reply Latest reply on Sep 10, 2008 1:25 PM by ntsiii

    Flash Vars is not working when we accessing from other class files

    kiranreddy_p
      Hi all, I'm currently developing a flex application where i need to pass the data from the flash vars to the other class files instead of the main actionscript class file.
      Does any body know how i should go about doing that?? you can see this below code : please help me out if u know how to solve

      ------------------------------------------------------------------------------------------ ----------------------------
      testnew2.as file
      package {
      import flash.display.Sprite;
      import flash.display.LoaderInfo;
      public dynamic class testnew2 extends Sprite {
      public var xmlfile:String=String(root.loaderInfo.parameters.lists);
      public function testnew ():void{
      }

      }
      }

      ------------------------------------------------------------------------------------------ -----------------------

      package {
      import flash.text.TextField;
      import flash.display.Sprite;
      import flash.display.LoaderInfo;

      public dynamic class testnew extends testnew2 {
      public function testnew () {

      var myText:TextField = new TextField();
      // this assumes that you are going to pass in an id variable
      // on the end of the myFile.swf?id=12345 or
      // use FlashVars in the HTML parameter list for instance
      // 'FlashVars', 'id=123456', 'width', '1024',


      myText.text = new testnew2().xmlfile;
      addChild(myText);
      }

      }

      }


      ------------------------------------------------------------------------------------------ -----------------------------------

      but if we access in same file it is working fine:


      package {
      import flash.text.TextField;
      import flash.display.Sprite;
      import flash.display.LoaderInfo;
      public dynamic class testnew extends Sprite {

      public function testnew () {

      var myText:TextField = new TextField();
      myText.text = String(root.loaderInfo.parameters.lists);


      addChild(myText);


      }

      }

      }