I am trying to use an instance variable as a parameter value in a method, but it is giving me an error. "Parameter initializer is unknown or is not a compile-time constant"
I want to use a non-constant instance variable though, and I assume there has to be some way around this besides calling this method from another method. Here is the code I'm referring to:
public function attack(target:Fighter=this.target):void {
}
public function attack(target:Fighter):void { if(target == null) target = this.target; }or you can only attack if a target has been previously set(maybe using apublic function setTarget(newTarget:Target):void, and so on. Hard to tell what would be the best solution without knowing more about your game