How to get text from textfield on the stage in Main class to external class
Hello, I've got little (I hope) problem.
I don't know how to get text from text field that is on the stage to external class code.
I think it might look like this:
Main class:
public var username:Textfield = username_txt;
External class:
import Main;
private var _mainClass:Main;
// place where I need to get the text
vars.username = _mainClass.username.text;
but code above is not working because I'm getting this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Thank you so much in advance for all help ![]()
