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
Im looking to make the brightness of footage being captured by a webcam as a trigger to start or stop an event or animation. basically when the brightness being captured by the webcam goes below a certain level a layer will be effected and when the brightness goes back above this level it will revert back to its original state.
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..
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?
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."); }
have about 100 small square sprites in a grid, they all have their own color that is stored in an array of hex values.I'm trying to assign different z values to each square depending on it's hex value, so the darker the hex value the further back (higher z value) the square is positioned, and the lighter it is the further forward. I guess I need a function that returns a Number depending on the hex passed in, so for example I pass in "ff534751" and it will return a Number somewhere between say 100 for black and -100 for white? I hope that makes sense?
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"
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,
I have a movieclip acting as a button and when the mouse rolls over it I would like the symbol to brighten slightly. Is there a way to do this in actionscript 3?
is there any way to control the brightness of a movie clip or button on mouse roll over so that it gets brighter when the mouse is on it? I could only find things for earlier versions of AS and i couldnt figure out how to change them..
I was working on a project a few months ago, which I had to put on hold but am finally getting back to. One major feature I need that I wasn't able to figure out before was how to measure the average brightness of an image file loaded as a movieclip. I remember spending hours going through tutorials but I wasn't able to get it working. Now I don't even remember what or where I read before and I'm not keen on rereading all of it and still not knowing what to do.
I just want the simplest possible way to get an average brightness level of an image, I don't care which way the brightness is measured as it is only important relative to other images which will be measured the same way.
How can I change the brightness of a MovieClip dynamically through actionscript? I've seen a few examples online but none of them are working too well.
I have imported all SliderEvents , ColorTransform, and Sprite events.. I defined each variable and gave both my 'image' and 'panel' their instance names.
My 'bValue' textfield has been given the instance name of 'bValue' .... here's the file to show you all what I mean.
What else do I need to do for this to actually do something??? I studied a little as3 in the past and learnt how to make mc's and that's about it...
Does anyone know how to control the brightness of a movieclip through action script. I can't seem to find the syntax for that property (if there is such a thing).
What I'm trying to achieve is have my images "flash/shine" when the cursor passes over the image, however; I want it to adjust to say +100, then back down to 0 immediately, not on roll out. The code I have thus far works perfectly fine for over and out.
On the main timeline I have a graphic of a hill and tree that darkens when clicking a button. I also have a movieclip called "creature" that has a little creature walking from one end of the stage across to the other. I need a script that will control the brightness of the "creature" movieclip at the point where the main timeline animation goes dark because the "creature" movieclip sticks out like a sore thumb at that point and needs to be darkened.
how can i adjust brightness with actionscript,is just that im a begginer and only know to adjust alpha, but now I want to adjust the brightness to a graphic that`s inside a movie,
I am having a few difficulties trying to add a slider to adjust the brightness of a movie clip. So when i slide the slider to the left it changes to a dark skin tone and to the right a lighter skin tone.
Is there any fringe api to increase the screen brightness in adobe air for android? I am making a morse code app and it could really use a pump in brightness while the app is in use. If its not yet implemented, then this would definitely make a nice addition.
Is there a color transform tool that lets me affect the brightness of colored pixels only? For example, if I have an image that has a lot of grays and blacks, but a colored dot in the center, is it possible to only affect the brightness of the colored portion?
The solution I'm looking for does not involve making the colored dot in the center its own movie clip, just so you know.