Hi,
We have a problem.
We have 2 classes. Let's call them A and B.
Inside A we have the following function:
Code: public function createMainField():TextField
{
mainField=new TextField();
mainField.text="ROFL";
addChild(mainField);
return mainField;
}Inside B we have the following function:
Code: private function traceTextOnClick(evt:MouseEvent):void {
trace(classA.mainField.text);
}The bolded code part of the code is where we get the following error when clicking the button with class B's attached to it, even though we have tried various ways:
Error #1009: Cannot access a property or method of a null object reference.
So, question is: How do we access the .text from ClassA's TextField in class B?
ps. We have left our irrelevant part of the code, for easier readability.
Hoping for a quick answer
Zumzar
Trace textfield.text from another class
Thursday, June 7, 2012
[Action Script] Trace textfield.text from another class June,2012
Posted by Bimo Hery Prabowo at 3:13 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment