I have a class that inherits from NetConnection, with the following function:
override public function connect(command:String, ... arguments):void
{
addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
super.connect(command, arguments);
}
What I want to do is effectively this:
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
}
}
Is this possible in AS3? If so, how? How would I declare the variable, set it, pass it into the function, etc.? Thanks!
Something like this in
connect:And in
onNetStatus:This means that calling e.g. (bogus arguments):
will result in what amounts to this call from
onNetStatus:More about
.apply(): http://adobe.ly/URss7b