I'm new to JavaFX, trying to use bind like this:
public function newCircle() : Circle 开发者_运维技巧{
Circle {
centerX: 1
radius: bind (centerX / prm._iMaxPop)
}
};
I get "Non-static variable centerX cannot be referenced from a static context." Also tried using this.centerX with same result.
Thanks in advance.
Try using this:
function newCircle() : Circle {
var xVal =1;
Circle {
centerX: xVal;
radius: bind (xVal / prm._iMaxPop)
}
}
Can add a temporary variable "c" which must be explicitly typed:
public function newCircle() : Circle {
var c : Circle = Circle {
centerX: 1
radius: bind (c.centerX / prm._iMaxPop)
}
};
精彩评论