Why won't this data respond?
using a setter to set an array but it's not tracing. ignore the super's they're working.
////////////////////
package {
public class super_example extends real_class {
private var myArray:Array;
public function super_example() {
trace("I am the text contained in the main class");
if (myArray != null) {
super("hi");
}
super.another_function();
}
public function set array(ar:Array):void {
myArray = ar;
}
public function get array():Array {
return myArray;
}
public function nother_example() {
trace(myArray);
}
}
}
//////////////////
FLA FILE
var superClass:super_example = new super_example();
var myArray:Array = new Array("1","2","3","4");
btn_mc.addEventListener(MouseEvent.CLICK,work,false,0,true);
function work(e:MouseEvent):void {
superClass.array = myArray;
superClass = new super_example
superClass.nother_example();
trace(superClass.array);
}
trace(myArray);
////////////
Trace statement after clicking
I am the text contained in the main class
I am the text passed in another function
1,2,3,4
I am the text contained in the main class
I am the text passed in another function
null
null