Step 1. Begin with the standard invite implementation.

Step 2. Make sure you have included both the core script somewhere in the document head.

Step 3. You need to have at least one invite button on the page. This can be hidden if you have created a custom button (as long as your custom button includes the green icon).

Step 4. Add the populateInviteData() function to the page. This is the function you’ll call to set the invite variables using Javascript after the page has already loaded.

function populateInviteData(iTitle,iLocation,iTicketURL) {

//accepts any of the possible fields that the widget accepts
//you do not need to include any variables that you are not changing
json = {
title:iTitle,
location:iLocation,
tickets_url:iTicketURL
...
//launch the invite
loadInviteInModal(0);
}

Note: at the end of populateInviteData() there is a call to the function loadinviteInModal(). This second function launches the invite as if the user had clicked the invite button. Choosing to call this function depends entirely on your implementation (it is not required).

You will want to change populateInviteData() JS to accept parameters for the variables you’ll want to set dynamically. You can then call this function from links, forms, or other functions.

In order to use invite from within Flash, use ActionScript to pass the necessary information to PopulateInviteData(). There are many resources available for learning how to access Javascript from ActionScript.