Be a Supporter!

Browse Sections


Newgrounds Wiki: Connecting to the API Gateway

Once you have installed the API package, you will need to use it to connect your game or movie to the API gateway.

The API gateway is the part of the API hosted on newgrounds that handles any API commands, version control and movie protection options.
  1. Open the components panel (Window->Components or CTRL+F7)
  2. Locate the API Connector component from the NewgroundsAPI group and drag it onto the stage (ideally on the first frame) of your game or movie.
  3. Highlight the new component on your stage and open the component inspector (Window->Component Inspector or ALT+F7)
  4. Fill in the "API ID" and "Encryption Key" parameters using the values found on the "API Dashboard" of your API entry.
  5. If you are using the version control tool, fill in the "Version" parameter with your current version number.
  6. Test your movie. If everything is correct, you will receive a message in your output panel confirming the movie has connected.

Click here for more information about the API Connector component.

Flex, FlashDevelop, FDT, mxmlc, etc...

Use the following code (using your API ID and Encryption Key):
import com.newgrounds.*;
API.connect(loaderInfo, "Movie ID", "Encryption Key");