Here we explains how to embed face recognition feature to your web page.
Face recognition program generated by facekit.net runs on Flash execution environment on your web browser. You can embed face recognition program to your own web page by following simple procedures.
1. Import Javascript file
Import Javascript file “swfobject.js”, by inserting following code on the head part of your HTML.
2. Decide where to place face recognition program
Insert following code to the place where you want to put the face recognition program.
This page requires flash9.
Please install or upgrade flash player if you see this message.

3. Insert Javascript code
By inserting following Javascript code, the face recognizer will show up on the place you have defined in step 2.
var so = new SWFObject("http://facekit.net/flash/facekit_1", "facekit_1", "320", "263", "9", "#869ca7");
so.addVariable("url", location.href);
so.write("flashcontent");
(4). Use face recognition result to control your web page
To use face recognition result, modify the Javascript code written in step 3 as follows.
var so = new SWFObject("http://facekit.net/flash/facekit_1", "facekit_1", "320", "263", "9", "#869ca7");
so.addVariable("url", location.href);
so.addVariable("callback", "getResult");
so.addParam("allowScriptAccess", "always");
so.write("flashcontent");
By this modification, the face recognition program will call the function “getResult” for each time of the recognition loops. Recognition result is given as following JSON format on calling the function “getResult”.
{
state: "detected", // Detection result "detected" or "none"
label: "front", // Recognition result
x:40, y:50, // Detected position
width:20, height:20, // Size of the detected face
time:100.0 // Timestamp (only when the input type is flv)
}
By creating a function like below, you can now create a dynamic web page which changes it’s behavior depending on the recognition results.
function getResult(value) {
var data = eval("("+value+")");
if (data.label == "left") {
do_something...
} else if (data.label == "right") {
do_something_else...
}
}
You can see a concrete example of above features from this page.