• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

4.7 actionscript project with two .as files

New Here ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

hi,

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?

Thanks

GReg

Views

438

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2014 Jul 07, 2014

Copy link to clipboard

Copied

LATEST

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 {

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines