ActionScript 2.0 :: Webcam Color Scan Detection And Play Connected Sound

Oct 7, 2009

I'm working on a school project that will work so that a webcam can scan a grid of colors and determine what color it is and there by playing a sound that is connected to that color. You can then create music by drawing different colors on a grid.

So I managed to import the webcam image to flash, and that's all. How do I Proceed?
* How do I get the webcam to detect colors? (Green, Blue, Red, Yellow and Black)
* How do I connect these color detections to start playing a sound/movieclip?

This is the code id used to import the webcam.
Code:
import flash.media.Camera;
import flash.media.Video;
var camera:Camera = Camera.getCamera();
if (camera != null) {
video.attachCamera(camera);
} else {
trace("You need a camera.");
}

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Brightness/darkness Detection With Webcam?

Sep 27, 2009

I would like to ask that how can I use the webcam in AS2 for brightness/darkness detection.I've found many topics in motion detection, but they are not useful for me, and they are too complex.hat I want is only an image with alpha level which is react with the light in the room. If the webcam get a dark image (the light are turned off in the room)The alpha of the image goes to 0

View 2 Replies

ActionScript 2.0 :: Flash8 Webcam Motion Detection

Jan 24, 2006

I'm currently trying to use flash8 and my webcam to do something similar to [URL] I've just started playing with camera scripts and therefore am stuck with quite alot of problems. But i decided to go on step by step. First problem i met, I am unable to display the snapshot of my webcam into a movieclip.. As in i want to take a frame of my webcam input and draw it into a movieclip.. (so i can compare with later frames to see if there is any motion.) Anyone can help me out here? What is wrong with my script? It's just supposed to take the webcam image on every enterframe and input it to my movieclip right beside my live input of my webcam.. But it appears as a blank MC..

[Code]...

View 9 Replies

ActionScript 3.0 :: Unplugged Webcam Detection In Trace Constantly

Jul 22, 2009

I have this code in my application:
ActionScript Code:
this.cam = Camera.getCamera();
trace("webcam:", this.cam, this.cam.name);
The problem is, the "trace" ALWAYS displays [object Camera] <camera name>, no matter if my webcam is plugged or not. How can I detect if a webcam is not plugged?

View 0 Replies

ActionScript 3.0 :: Flash Webcam Motion Detection Activates A GotoAndPlay Action

Aug 8, 2010

I'm trying to play around with a flash scene which would only progress from area to area if there is any motion being detected by the webcam.

View 2 Replies

Save Flash Game And Play It Without Being Connected To The Internet?

Jul 9, 2011

Can I play Desktop Tower Defense without being connected to the Internet?

I can load the page and then disconnect from the net but my question is if I can download the game and play any time without connecting to the net.

View 1 Replies

Flash :: Color Detection In AS3?

Oct 30, 2010

I was wondering what do the AS3 experts would do to detect a color with the webcam (red) and draw a sprite on those color boundaries.

View 2 Replies

ActionScript 2.0 :: Detect Color Using Webcam?

Aug 9, 2009

Currently making a music project that will, in theory, play sounds based on detected colors a webcam can see.

I'm certain this is possible in either AS 2 or 3 - but unsure exactly how.

I've searched the wonderful nets for a tutorial or an example of this being done with flash but have come up with nothing.

Is there any tutorials for detecting colors and then responding to them? (All as viewed by webcam, so in real-time).

View 5 Replies

ActionScript 3.0 :: Detect A Color Via Webcam

Aug 16, 2009

I need help with a small flash project i'm doing. Basically the task is to detect a color via webcam, then respond to what colors it can see (using the webcam). Example Color red is held in front of camera - flash sees this, then respond by playing a sound. green and red is held in front of cam, flash can tell there is two colors, plays a sound. etc would writing the webcam video object to a BMD every frame, then getPixel that to work out the colors? I'm guessing i'd need to use colorTransform to merge all the blues, reds, greens, etc together (so it only checks for those 3) then responds if it finds them with getpixel?

is there any examples of that, or something similar i could work from? would anyone be able to give a quick write up of what this might looklike/how to do it? (havent done much programming in as3) All i need it to do is: Check video for range of colours (ie, blue, light blue, dark blue, etc, all are equal to blue, unsure how i'd do this. Was thinking Yellow, Red, Green, Blue as the 4 colours) If any of those are in the video, then respond by playing a sound. (However if yellow and blue are in the video at the same time, play a DIFFERENT tune)

View 1 Replies

Actionscript 3 :: Check A Pixels Color Value And Use It For Mouse Hit Detection?

Oct 5, 2011

I have a bitmap with many colors inside it. I want each color, when clicked, to preform a different method. How do I determine the pixel's color value and use it for a mouse event? I found bitmap hit detection but I cannot figure out how to use it (because I have many colors inside the bitmap).

View 2 Replies

Actionscript 3.0 :: Remove A Background Color From Webcam?

Oct 20, 2010

how remove a background color from web cam in as3?

I need to do chroma key with a web-cam in browser !

View 1 Replies

ActionScript 3.0 :: Collision Detection And Sound Effect

Nov 9, 2010

I'm having trouble trying to get my sound to only play once if it hits test object. As of now, if the mc remains in contact with the hto then the sound continues to play over and over. What I really need is for the sound to play once and only play again if the mc is moved off of the hto and then back on. Btw, it is a car and a building. Here is what I have so far:

[Code]....

View 2 Replies

Actionscript 3 :: Get The Bytearray From The Image And Sound From The Client's Webcam?

Dec 13, 2010

i try to get a bytearray from a webcam. i can get the image of the webcam, copy it to bitmapdata and get the bytearray. but is it possible to get the bytearray from the image and sound from the client's webcam?

View 2 Replies

ActionScript 3.0 :: Sound Detection And Visual Output - Trigger A Video When It Hits A Certain Volume

Dec 15, 2011

So i found a code on the adobe site which pics up input from the mic. I need that to trigger a video when it hits a certain volume. I'm a complete novice to AS3 and i need this for a proof of concept in the morning. Here's the code that i'm using to pick up the mic -

[Code]...

View 0 Replies

ActionScript 3.0 :: Sounds Play A Little Delayed/weird Detection?

Jan 25, 2012

I'm trying to make an instrument type thing.[URL]... How come the sounds play about half a second after you hover your mouse on one of the circles? I need it to be completely instant.

[Code]...

Also, sometimes, it just doesn't detect the hover at all and doesn't play a sound (if you hover too fast)..

View 5 Replies

ActionScript 3.0 :: Create Dynamic Sound To Play Sound-file?

Oct 14, 2009

It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.

But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!

View 9 Replies

ActionScript 2.0 :: Play Sound/stop Sound Button?

Feb 13, 2007

i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.

View 13 Replies

Media Server :: "RTMFP" Connected To The FMS Server,but May Not Play Multicast Video?

Sep 23, 2011

the question is,a client which can use "rtmfp" to connect to a FMS server,and the connecting success,Whether Can not guarantee that the client can play the Multicast video? because the client may be behind a Special firewall So he may connect to the FMS server ,but can not  use P2P to connect to the  members those are in the group?
 
If the answer is "yes",Whether i should make a check function that make these client  back to "RTMP"?

View 1 Replies

Media Server :: FMS 4 - FLV Not Saving - Record Video From The Users Webcam And Play It Back At A Later Date

Mar 24, 2011

I'm trying to record video from the users webcam and play it back at a later date.
I call

[Code]...
 
However, when I look at the FMS Admin Console at the streams in app/_definst_, their types are either "NetStream" or "Live". If they were being saved wouldn't they say "Stored"? After I close the application doing the recording, the "NetStream" type stream disappears, and after a while all the "Live" typed streams are gone too. Nothing is saved.

I have no idea what is happening. I don't know if it's a problem with my AS3 code not closing the recording properly or if I'm doing something else wrong, or maybe somethgin isn't right in the FMS?

View 1 Replies

ActionScript 3.0 :: Mouse Detection And Speed Detection Handlers?

Apr 23, 2011

how to work out the direction of the mouse on stage and say from this:

"if the mouse goes from the left to right (visa-versa) once, add score +1" and "if the mouse speed which is player controlled - slows down - to then display an error graphic"

View 21 Replies

IDE :: Add Sound - Sound To Play On The 'Over' State

Mar 6, 2009

I'm trying to add sound to some buttons. It's just a little metallic 'klink' sound that plays on rollover. I only want the sound to play on the 'Over' state. So I've set up a layer (just for sound) for the button and I add my sound in the 2nd frame (the Over state). Everything is cool. All is good. And the sound plays on rollover. But the sound also plays when I click the button (i.e. it also plays on the "Down" state). Why? The Down state keyframe is completely empty. What's going on here? I've only put the sound in the "Over" keyframe, why does it also play in the "Down" frame (or when I click)?

View 1 Replies

Actionscript 3 :: Scan Image For Other Images?

Apr 17, 2011

I know this doesn't have a simple answer, but I want to learn how to scan images, and thus videos (frame-by-frame) and identify other images in that initial image with a given amount of error.

View 1 Replies

ActionScript 2.0 :: Pre Scan All Frame Labels?

Dec 2, 2010

When I first open my project, I want the visuals to stay on the 1st frame, while Flash scans through and creates an array of all the frame labels and their relative frame numbers.

Would be useful to be able to specify a layer to search for labels on, and/or search for any and all frame labels in an mc.

View 1 Replies

ActionScript 2.0 :: Flash Movie To Scan The Dir?

Feb 21, 2010

I want the flash movie to scan the dir, like: news/In news i have a few txt. files:

news/1.txt
news/2.txt
news/3.txt

I want it to return a array [1.txt,2.txt,3.txt] But when i ad one.

news/4.txt

it automaticly returns an array with [1.txt,2.txt,3.txt,4.txt] in it. how would i do this?

View 10 Replies

ActionScript 2.0 :: Flash Movie To Scan The Dir

Jan 25, 2004

I want the flash movie to scan the dir, like: news/ In news i have a few txt. files:

[Code]...

I want it to return a array [1.txt,2.txt,3.txt] But when i ad one. news/4.txt it automaticly returns an array with [1.txt,2.txt,3.txt,4.txt] in it. how would i do this?

View 3 Replies

ActionScript 3.0 :: Pitch Detection And Beat Detection?

Jul 29, 2010

Is there any as3 based source code that accomplishes pitch detection or beat detection accurately? Doesn't have to be both, if you know of at least one of those,

View 4 Replies

ActionScript 2.0 :: Play Sound Like "stop All Sound" Option In Flash?

May 17, 2003

I want to use a sound loop in my flash movie. The movie has many scenes. And the problem is that when I go to next scene or different scene I hear the sound repeating twice. I mean sound does not stop from first scene and begins from the different scenes.Is there any way to play sound like "stop all sound" option in Flash.

View 6 Replies

ActionScript 3.0 :: Play A Sound File And Show The Progress Of The Sound File Being Played

Mar 16, 2009

I have to play a sound file and show the progress of the sound file being played. I am using import flash.media.Sound; import flash.media.SoundChannel; But the PROGRESS event gives theprogress of loading of file. I want to know of much of the song has been played and how much more is left.

View 3 Replies

ActionScript 3.0 :: Scan And Resave Text File?

Jun 9, 2011

Way I can import a .txt file into flash, check for EXACT duplicate words and then resave it out as a .txt file with the duplicates removed ?

View 6 Replies

AS3 :: Flash - Recursive Object Scan Without Repeats?

Jun 12, 2011

While recursive scans are commonly use to scan through nested objects / data. It can go on an infinite loop, if some of the objects references one another. So what is the most effective way to scan all items, without crashing the computer, nor skipping a specified parameter?

Here is an example of a recursive scanner...

/**
* Triggers the scan function for each object given
**/
function recursiveScanner( object:* , scanFunction:Function ):void {

[Code].....

The objects will trigger scans for one another in an eternal loop.

I do believe in C/C++ : Each scanFunction call, will be added into a list consisting of scanned 'memory address', thus preventing a repeat. Is this even possible in AS3? Is there a more elegent way?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved