code: function callback(err, callbackId) {
      // There is a single callback for all load events, so make sure this
      // is the right one.
      if (callbackId !== imageId) {
        return;
      }
  
      stage.removeFlashCallbackListener('imageLoaded', callback);
  
      // TODO: is there any way to distinguish a network error from other
      // kinds of errors? For now we always return NetworkError since this
      // prevents images to be retried continuously while we are offline.
      if (err) {
        done(new NetworkError('Network error: ' + url));
      } else {
        done(null, new FlashAsset(flashElement, imageId));
      }
    }
docs: TODO: use a single callback for all imageLoaded events.