NaN:NaN
NaN:NaN
--:-- / --:--
Newgrounds Background Image Theme

TheafterWeirdio 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!

Browse Sections

Newgrounds Wiki: connect

Page Contents

import com.newgrounds.API;


API.connectMovie(api_id:String, encryption_key:String, debug_mode:Boolean);
import com.newgrounds.API;


import com.newgrounds.APIEvent;


function onAPIConnected(event:ApiEvent):void {


    if (event.success) {


        trace("You have connected to the API");


    } else {


        trace("The connection has failed");


    }


}


API.addEventListener(APIEvent.API_CONNECTED, onAPIConnected);


API.connectMovie(<api_id>, <encryption_key>, true);
  • Actionscript 2.0
import com.newgrounds.API;


import com.newgrounds.APIEvent;


function onAPIConnected(event:ApiEvent) {


    if (event.success) {


        trace("You have connected to the API");


    } else {


        trace("The connection has failed");


    }


}


API.addEventListener(APIEvent.API_CONNECTED, onAPIConnected, true);


API.connectMovie(<api_id>, <encryption_key>, true);