F
fzl2007
I have four classes that are extended from the same superclass. Each
class need to be able to get the value (rssdid) that the other class
set. How do I do that? I have tried to use the getter and setter. It
seems to work only within one class, other class can't get the value.
It is null.
I am using actionscript but the OO theory should be the same.
This is the class for the variable to share among subclasses.
public class LocalVO {
private var rssdid:String;
public function LocalVO(rssd:String) {
this.rssdid = rssd;
}
public function getRssdid():String {
return this.rssdid;
}
public function setRssdid(value:String):void {
this.rssdid = value;
}
}
This is what I have in the superclass:
public var localRssdid:String;
public var localVO:LocalVO = new LocalVO(localRssdid);
public function setMyRssdid(value:String):void {
localVO.setRssdid(value);
}
public function getMyRssdid():String {
return localVO.getRssdid();
}
This is how I get it in the subclass:
getMyRssdid();
The problem is the value set in one subclass is not accessible to
other subclasses.
What did I do wrong?
I appreciate any input.
Thanks.
Faye
class need to be able to get the value (rssdid) that the other class
set. How do I do that? I have tried to use the getter and setter. It
seems to work only within one class, other class can't get the value.
It is null.
I am using actionscript but the OO theory should be the same.
This is the class for the variable to share among subclasses.
public class LocalVO {
private var rssdid:String;
public function LocalVO(rssd:String) {
this.rssdid = rssd;
}
public function getRssdid():String {
return this.rssdid;
}
public function setRssdid(value:String):void {
this.rssdid = value;
}
}
This is what I have in the superclass:
public var localRssdid:String;
public var localVO:LocalVO = new LocalVO(localRssdid);
public function setMyRssdid(value:String):void {
localVO.setRssdid(value);
}
public function getMyRssdid():String {
return localVO.getRssdid();
}
This is how I get it in the subclass:
getMyRssdid();
The problem is the value set in one subclass is not accessible to
other subclasses.
What did I do wrong?
I appreciate any input.
Thanks.
Faye