Allthough the following no longer seems to apply in AS3, it might be good to 
know.

In AS2, if you have the following class:

class MyClass {

private var myArray:Array = new Array();

public function addItem(item:Object) {
 myArray.push(item);
}

public function get data():Array {
 return myArray;
}

}

The myArray class member will be shared across ALL instances of the class.

var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();

instance1.addItem("Hello World");
trace(instance1.data);
trace(instance2.data);

//output:
Hello World
Hello World

regards,
Muzak

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to