Skip to content

Instantly share code, notes, and snippets.

@maxmonax
Created March 14, 2017 14:31
Show Gist options
  • Save maxmonax/6861665a9b8f2d4e2cd49be3789972e0 to your computer and use it in GitHub Desktop.
Save maxmonax/6861665a9b8f2d4e2cd49be3789972e0 to your computer and use it in GitHub Desktop.
public function isBlocked(): Boolean
{
if (_idnet != null && _idnet.type == 'protection') {
return _idnet.isBlacklisted();
}
return false;
}
@EddieOne
Copy link

Hi Max,

Make sure to check idnet.type inside handleIDNET as it is triggered by an event. Details are available here. You may need to connect classes, to get that data where you need it.

private function handleIDNET(e:Event) {
    if (_idnet != null && _idnet.type == 'protection') {
        otherCode.triggerProtectionMessage();
    }
}

You could also catch it in your idnet class and save it to a variable. However, this could have timing issues, if it gets checked before it is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment