1 Reply Latest reply on Jul 7, 2014 10:50 PM by Athaariq

    4.7 actionscript project with two .as files



      Using FB 4.7 to make actionscript project with two .as file: Main.as and GFX.as. There are variable in GFX that Main cannot access. WHat do I need to do to the GFX.as file to make the variables it declares readable by Main.as?




        • 1. Re: 4.7 actionscript project with two .as files
          Athaariq Level 1

          Reason 1:

          put public before var . Example: public var foo:Number


          Reason 2:

          the variable that you can't load in Main.as should be inside function GFX() body. Example:

          package {

               import flash.display.MovieClip

               public class GFX


                    public function GFX()


                         public var foo:Number  // Put your variables here that can be load by another class


                    function anotherFunction(parameters:Number) // Another function starts here


                         foo = parameters





          Reason 3:

          In Main.as, put import GFX after package {