Affichage des articles dont le libellé est webcam. Afficher tous les articles
Affichage des articles dont le libellé est webcam. Afficher tous les articles

mardi 22 juin 2010

webcam plus timer

We made an installation of all the computers in the class room using the webcam activity. A plan was made up by Rabia, Nieke, Giulia and Helena to make an experience of being shot at (when entering the room), using webcam to trigger sounds, then in the middle peacefulness using images which where triggered and get of the screen again, a last row in the back having silhouets (being stalked) leading up to a packman image...

Of course we have put the webcam out of the stage with:
video.x = -3000;

For the triggering and letting disappear the images we needed an extra timer in the webcam activity example:

import flash.display.Sprite;
import flash.events.TimerEvent;
import flash.utils.Timer;

var minuteTimer:Timer = new Timer(1000,1);

minuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);

function onTimerComplete(event:TimerEvent):void
{
winkelWagenMovieClip1.removeChildAt(0);
}
//minuteTimer.stop(); //these last lines to be added in the webcamActivityHandler
// minuteTimer.start();

and here you can find this example Flash CS4:
http://www.contrechoc.com/flash/flash-fun.zip

If you have Flash CS3 just put the textfile of this text in a new flash movie, save in a folder and create in this same folder the folders sounds and the folder images. In these last folders you can put your sonds (.mp3 format) and images. Change the names of these sounds and images in the script...
http://www.contrechoc.com/flash/webcamActivity_CS3script.txt


flash movie and folders structure

mardi 9 mars 2010

FLASH, webcam and microphone activity

Today we will be fooling around with webcam and microphone. The webcam can trigger loading of images and playing of sounds etc, so can the microphone.

Later on we will discover how to load streaming movies. (needed flv format: use Media Encoder of Video Encoder

The examples can be found here:

http://www.contrechoc.com/flash/flash-fun.zip

To get some streaming movies we could try to download movies in flv format from youtube.

If nothing is playing or the mic does not respond, first verify if the computer has a mic or webcam, and then try clicking right in the flash window and look at the settings.

ways to download from youtube can be found here:

http://www.frankwatching.com/archive/2007/05/08/top-25-hoe-download-ik-een-youtube-video/

used:

  • webcam activity: eventlistener
  • microphone activity: eventlistener

FLASH question time

Is it possible to get a webcam behind an image? (The idea is to have a png and to show the webcam behind the (transparent) holes in the image.

Yes, just do an addChild with a movieclip with a picture after adding the camera:

so we have:

var winkelWagenMovieClip1 : MovieClip = new MovieClip(); //some movieclip to put an image in
winkelWagenMovieClip1.x = 0;
addChild(winkelWagenMovieClip1);


then we load the webcam using the FLASH help example:
//bla bla bla like the flash help example….

if (camera != null) {
camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
video = new Video(camera.width * 2, camera.height * 2);
video.attachCamera(camera);
addChild(video);
loadImage( winkelWagenMovieClip1, “1.jpg”, 40,0 ) //the method for loading a picture in the MovieClip
addChild(winkelWagenMovieClip1);

} else


////etcetera like the help example

and having this movieclip in front of the webcam image you can change or animate the things in this masking movieClip.



linux baby in front of the webcam