Always on top Webcam

I’m going to be doing a video critique of some source code later on today and the people being critiqued wanted to have my mug showing so they could see the looks of incredulity (I am kidding, of course).  So I did some looking around to find something that would keep the webcam software on top of the other windows.  Turns out there’s not much there or there was some kind pay mechanism and I really didn’t want to pay money to see myself in a webcam window that stayed above the other windows.

So, me being me, I decided to use our Flash Builder for PHP IDE and write what I needed.  It’s nice and simple.  Here’s the code.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="" 
 import mx.collections.ArrayCollection;
 protected var video : Video;
 protected var resolutions : Array = [{
 height: 480, width: 640
 height: 600, width: 800
 height: 768, width: 1024
 height: 720, width: 1280
 protected function initCamera() : void {
 if (video) {
 var camWidth : int = resolutions[cameraRes.value]["width"]; 
 var camHeight : int = resolutions[cameraRes.value]["height"]; 
 video = new Video(camWidth, camHeight);
 var camera : Camera = Camera.getCamera();
 camera.setMode(camWidth, camHeight, 30, true);
 width = camera.width;
 height = camera.height;
 <s:VideoDisplay x="0" y="0" width="100%" height="100%" id="videoDisplay" />
 <s:HSlider bottom="10" width="17%" change="initCamera()" horizontalCenter="-1" maximum="4"
 minimum="0" value="0" id="cameraRes"/>

Here’s the AIR file.  If you have AIR installed you can easily run it.  Here it is with a Windows installer.

Related posts

4 thoughts on “Always on top Webcam

  1. ben

    i love this, so simple, so right , so much easier than all the other nonsense. Thanks 🙂

  2. Bruce

    I love it… Is there a way to do this with an IP cam?

    1. Kevin Schroeder

      I’m sure there is, but I couldn’t help you. I haven’t done this in a while.

  3. Dr.Nagabhushana Rao

    It is a great software. Can you provide an option to resize and reposition the window.- say about 2 inches in the left upper corner. This would be very useful to project the speaker’s live video during a live powerpoint presentaion.

Leave a Comment