I’m starting out in AS3 and have hit a wall with using setters
I’ve set up my main movie clip. It has two mc’s on the stage both with externally defined classes. The first mc ‘Bank’ has this code;
package
{
import flash.display.MovieClip;
public class Bank extends MovieClip
{
private var _clientAccountValue = 0;
public static function set deposit(money:int):void
{
if(money > 0)
{
_clientAccountValue += money;
trace(_clientAccountValue);
}
}
}
}
The second mc ‘Client’ has the following;
package
{
import flash.display.MovieClip;
public class Client extends MovieClip
{
private var _checkValue = 10000;
public function Client():void
{
Bank.deposit = _checkValue;
}
}
}
The idea being the Client function sends the updated total to the Bank.deposit function. But I get this error: 1120: Access of undefined property _clientAccountValue.