Our goal is for Newgrounds to be ad free for everyone! Become a Supporter today and help make this dream a reality!

Newgrounds Wiki: APIConnector

  • Package: com.newgrounds.components
  • Class: APIConnector
The APIConnector component connects your movie or game to the Flash API. It should be placed on the first frame of your movie to ensure that the connection is established when the movie loads.

The APIConnector's API ID and Encryption Key parameters must be set with your movie's API ID and Encryption Key. For more info, see Getting Started with the API.

The APIConnector can optionally display a FlashAd and a Preloader. This is controlled by the connectorType setting.

The APIConnector component is intended for Flash IDE users. Users with a code-based workflow can instead call API.connect directly.


These are the properties of APIConnector.


public var adType:String = "Video";
Sets the type of ads that are displayed by the API Connector.


public var apiId:String;
The API ID for this movie. Set this to the API ID given on your API Settings page.


public var connectorType:String;
Sets the display mode of the API Connector.
  • Flash Ad + Preloader, displays both a Flash Ad and a Preloader.
  • Flash Ad Only, only display a Flash Ad
  • Invisible, the connector is not displayed, and only connects to the API.


    public var debugMode:String;
Disables or enables various debug modes, for testing purposes. Note that debug mode will automatically disable when the movie or game is viewed on the web. For more information, see [wiki/creator-resources/flash-api/about-debug-mode About Debug Mode].


public var encryptionKey:String;
The encryption key for this movie. Set this to the encryption key given on your API Settings page.


public var movieVersion:String;
The version number of this movie or game. This should be in the format of "1.0". If version control is enabled in your API Settings, the API_CONNECTED event will signal that a new version is available. If the redirectOnNewVersion property is enabled, then the user will automatically be forwarded to the latest version when they click the Play button.


public var redirectOnHostBlocked:Boolean = true;
If this movie is viewed on a blocked domain, this setting will redirect the user to the official URL when they click Play.


public var redirectOnNewVersion:Boolean = true;
If a new version of the movie is available, this setting will redirect the user to the official URL when they click Play.