             videoface.height = cam.height;
         }
 
+        public function callback(eventname:String, ... args) : void {
+            eventname = "cameraman._" + eventname;
+            var callargs:Array = [eventname] + args;
+            if (ExternalInterface.available)
+                ExternalInterface.call.apply(callargs);
+        }
+
         public function takePhoto() : void {
             // freeze image
             try {

                trace(err.name + " " + err.message);
            }

            if (ExternalInterface.available) {
                ExternalInterface.call('cameraman._droppedPhoto');
            }
        }

        public function sendPhoto() : void {

                trace(err.name + " " + err.message);
            }

            this.callback('tookPhoto');
        }

        public function dropPhoto() : void {
