1
votes

My company is looking to play Hollywood Squares for next year's Christmas party, and rather than build an entire 3x3 rig for people to sit in, I proposed that I just create a Flash presentation that broadcast 9 webcams to 9 people sitting safely on the ground.

Can anyone guide me to a tutorial on how to hook this up in AS2 or AS3, preferably AS2 since I'm not as well versed in AS3 as I would like to be.

Thanks in advance

1

1 Answers

0
votes

Well, in AS3, this is how it should work in theory, however since I only have one camera connected I cant test this myself. Also, people around the interwebs seem to be having some problems with this. Bear in mind that using this many cameras is likely to grind your application to a halt.

var totalRows:int = 3;
var totalCols:int = 3;

var videoWidth:int = this.stage.stageWidth / totalCols;
var videoHeight:int = this.stage.stageHeight / totalRows;

for (var i:int = 0; i < Math.min(Camera.names.length, totalRows * totalCols); i++) {
    var currRow:int = Math.floor(i / totalCols);
    var currCol:int = i % totalCols;
    var video:Video = new Video(videoWidth, videoHeight);
    var cam:Camera = Camera.getCamera(i.toString());
    if (cam) {
        cam.setMode(videoWidth, videoHeight, 30);
        video.attachCamera(cam);
        video.x = currCol * videoWidth;
        video.y = currRow * videoHeight;
        this.addChild(video);
    }
}

This answer assumes you want to connect all cameras to one computer. Another way to go about this is to hook each camera up to a separate computer and feed the camera streams to a tenth computer for display.