00:00
00:00
Newgrounds Background Image Theme

orafice13 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

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.

Properties

These are the properties of APIConnector.

adType

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

apiId

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

connectorType

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.

    debugMode

    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].

encryptionKey

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

movieVersion

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.

redirectOnHostBlocked

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.

redirectOnNewVersion

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.