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.
Click here for more information about the API Connector component
- Open the components panel (Window->Components or CTRL+F7)
- 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.
- Highlight the new component on your stage and open the component inspector (Window->Component Inspector or ALT+F7)
- Fill in the "API ID" and "Encryption Key" parameters using the values found on the "API Dashboard" of your API entry.
- If you are using the version control tool, fill in the "Version" parameter with your current version number.
- Test your movie. If everything is correct, you will receive a message in your output panel confirming the movie has connected.
Flex, FlashDevelop, FDT, mxmlc, etc...
Use the following code (using your API ID and Encryption Key):
API.connect(loaderInfo, "Movie ID", "Encryption Key");