Is there a way for other classes to recongnize a public variable in another class? : I am very new to this language and i am not too sure how to effectively use it.The coding language i am using is AS3 with flash Devlop. What i am trying to do is to allow the class Chapter to access a public variable in the class Main Menu. The variable is named YesNo and when i try to access it in the class Chapter it doesn't work. I had downloaded something called Flashpunk that came with presets for multiple different classes that helps with making games,i will show my Code below.

Main Menu

    package 
    {
    	import net.flashpunk.Entity;
    	import net.flashpunk.graphics.Image;
    	import net.flashpunk.utils.Input;
    	import net.flashpunk.utils.Key;
    	import net.flashpunk.FP;
    	
    	public class MainMenu extends Entity
    	{
    
    		[Embed(source = "net/MainScreen.png")]
    		private const SPRITE1:Class;
    		
    		private var sprite1:Image = new Image(SPRITE1);
    		
    		public var YesNo:int = 0
    		
    		public function MainMenu() 
    		{
    			graphic = sprite1;
    			sprite1.centerOrigin();
    			
    			x = 200
    			y = 150
    			
    			layer = 150
    		}
    		
    		
    		override public function update():void
    		{
    			if (Input.pressed(Key.DIGIT_1))
    			{
    				YesNo = YesNo + 1
    			}
    			
    			if (Input.pressed(Key.DIGIT_2))
    			{
    				YesNo = YesNo + 2
    			}
    		}
    			
    	
    		
    		
    	}
    
    }

Chapter

    package 
    {
    	import net.flashpunk.Entity;
    	import net.flashpunk.World;
    
    	public class Chapter extends World
    	{
    		
    		public function Chapter() 
    		{
    			add(new MainMenu())
    		
    		}
    		
    		
    	}
    
    }

