次の関数を使用して、NetConnection から継承するクラスがあります。
override public function connect(command:String, ... arguments):void
{
addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
super.connect(command, arguments);
}
私がやりたいことは、効果的にこれです:
override public function connect(command:String, ... arguments):void
{
m_iTries = 0;
m_strCommand = command;
m_arguments = arguments;
addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
super.connect(command, arguments);
}
private function onNetStatus(pEvent:NetStatusEvent):void
{
if (/* some logic involving the code and the value of m_iTries */)
{
super.connect(m_strCommand, m_arguments);
}
else
{
// do something different
}
}
これは AS3 で可能ですか? もしそうなら、どのように?変数を宣言し、設定し、関数に渡すにはどうすればよいですか? ありがとう!