【发布时间】:2014-03-07 01:27:35
【问题描述】:
好的,看来我通过将所有内容都转换为公共静态来解决了以下问题。但是数学函数呢? Error:Call to a possibly undefined method Round through a reference with static type Class
我是 AS3 的新手。这只是我编码的第二天.. 但似乎 成为我无法理解为什么会发生的事情。
private var baseExp:int = 10; private var offset:int = 32; private var expCurve:Number = 1.036486; //------------------------ private var nextExp:Number = Math.Round(Math.Pow((base_stats[0] * (baseExp / expCurve)), expCurve * (1 + (base_stats[0] / (offset * 5))))); private var _nextExp:Number = nextExp; private var currentExp:int = 0; /* * Check Exp if player can LEVEL UP */ public static function CheckExp():void { if (currentExp >= nextExp) { base_stats[0] += 1; //Add Stat Increments here currentExp -= nextExp; for (var i:int = 1; i < base_stats.length; i++) { trace(base_stats[i]); } } if (nextExp != _nextExp) { RefreshRequiredExp(); _nextExp = nextExp; } } I declared nextExp, _nextExp and currentExp as private... but when I call them in the static function CheckExp, it throws the `Access of未定义的属性 nextExp` 等等等等
And also an `Error: Call to a possibly undefined method Pow through a reference with static type Class.` in the Math functions. Is there something wrong I'm doing?
【问题讨论】:
标签: actionscript-3 flash