Documentation and API for Make My Picture, 1.0

Embedding the application in a web page

Embedding the application in a web page: Embed Code

The application is a SWF file, so it must be embedded into the web page. You can use Adobe's embed code, but using the swfobject is much easier and more standards-friendly.

Embedding using the swfobject is a two-step process. First, you must load the Javascript file into your web page. Google hosts the file, so you can load it from Google thusly:

	

Second, you call the swfobject and pass it parameters thusly:


The parameters are described in detail below.

Embedding the application in a web page: Required Parameters

The following variables must be passed to the application (via the Flashvars in the embed code):

VariableValue
FileName The name of the picture when uploading or downloading.
Server The full path to the server-side script that handles the file upload. See the sample embed code above for a reference.
LicenseKey The license key that you purchased to unlock the application. It will be a long string of text something like this: 2317e23c2a080396968d6ef2ddec8302. A license key is locked to one domain. If the license key is wrong, incomplete, or for the wrong domain, the application will enter into demo mode.
Format The format that you want to create the image file. Your choices are PNG and JPG.


Setting the File name dynamically

You can use a Javascript command to change the FileName parameter dynamically. The command to set the FileName parameter is "setName()" and must include as a parameter the new name.

For example, this command will set the FileName to "HOOHA:"

	function changeName(){
		document.getElementById("makemypicture").setName("HOOHA");
	}

The document.getElementById() command allows Javascript to locate the embedded SWF. The "makemypicture" parameter is the name of the SWF, as indicated by the embed code (attributes.id="makemypicture";).