ActionScript 3.0 :: Flash Camera With Object Detection?
Sep 19, 2010I want to make a cam application. When user's show the objects (sample is in the attach) Flash will play a video. How can I do this?
View 1 RepliesI want to make a cam application. When user's show the objects (sample is in the attach) Flash will play a video. How can I do this?
View 1 RepliesI'd like to keep an object appear to remain in the same place while moving the camera.I'm using this scriptto orbit an object using a mouse drag. But I have an object in the scene that I would like to keep still. How to I do this?
View 1 RepliesI'm developing a flash application. I am looking for a simple way to animate my camera's movement. Is there any built in tweening library that supports the camera object? I've checked out greensock.com, but I couldn't figure out how to use their libraries for the camera object.
EDIT: by camera I mean the viewing perception. Not a real hard drive web camera.
I am wondering if there's any way I can track objects in Flash video using ActionScript? For example, let's say I would like to track a red ball, how can I do this? I have seen some examples using the OpenCV port but the examples shown are for face detection. And I can't seem to figure out what's the difference between the OpenCV port and the actual OpenCV library itself. Is it a full port?
View 1 RepliesIn OpenCV, we can use a xml file to describe haar-like features of a specific object. I wanna use this idea to detect palm and fist, now I hava my own xml feature file, and it works well in C and Python(with OpenCV), now I need to move this idea to flash.
Luckily, I found an project named Marilena, it successfully moved the haar-trainning part of OpenCV to actionscript, and this article optimizing flash based face detection optimized Marilena, he turned the xml file into actionscript class itself to speedup the calculation. However, since the Haar data is being hardcoded into the class now it will not be able to use for tracking anything else but faces. I try to read the source code for detail, and process my own xml file into actionscript class file in his way, but finally find something different.
The xml file for face detection is like :
Every tree has only one node "root node", but in my xml file, some trees have two nodes, and the "left_val" above changes to "left_node" sometime, I don't know how to process these nodes. I think I should goto OpenCV C source files for detail to find how to correctly process xml feature file, but where to start,
From a Flash object, I would like to be able to detect the presence of a webcam that the user might grant access to, without actually asking the user whether they want to grant access. This is to streamline a large application that has extra features if a webcam exists — if there is a webcam, the application will present several dialogs that lead up to the normal cam-security prompt, but if the user doesn't have the hardware, I want to skip over them altogether. Requesting access to the cam before those dialogs won't make sense to the user.
It appears not to be possible to call Camera.getCamera() without the security prompt happening. Is there a workaround? (For instance, could I, perhaps, call getCamera in a hidden Flash object and inspect its return value, or does it block until the user acknowledges the security prompt?)
Usually Adobe Flash applications can access any usb-webcam.I have a USB camera for microscopes which understands TWAIN and DirectShow.Is there a possibility to access the video data from this camera with flash?
View 1 Repliesi'm currently using hitTestObject and it kinda sucks, my object doesnt get very close the the second object but the game "thinks" it does. is there a better hit detection?
View 7 RepliesI need to know how to have an object be recognized when it passes over a point on my stage. Then once that has happened an event happens such as a new screen appares.
View 3 RepliesI've been working on an iPhone app developed with Flash CS5 that will stream the camera view to a window on the app screen. The camera code is as follows:
cam.setMode(600, 400, 25);
cam.setQuality(0, 100);
vid = new Video();
[Code]....
I set the iPhone to stay in a portrait orientation constantly by setting stage.autoOrients = false and stage.setOrientation( StageOrientation.DEFAULT ). However, the camera still displays as if the phone was flipped 90 degrees to the left. How can I change it so the program stays in portrait orientation and the camera is oriented correctly?
I need to detect collision between my bezier curve (drawn using curveTo method) and a object, the curve is dyanamic and hence the equation changes every frame. I am looking for a efficient method to detect collision between curve and the object.
View 1 RepliesI read the tutorial about Multiple Object Collision Detection. What I want to do is have there be 3 circles and 3 squares. the circles are moving randomly while the squares are stationary. The actionscript would need to be checking to see whenever the moving circles collide with the stationary squares. However, it doesn't seem to be working. I followed the logic of the tutorial pretty closely, by making a separate list for the instance names. Here is the code for the collision detection.
[Code]...
I want to create a function in which I can drag a MovieClip which will bump into other MovieClips on the stage without overlapping them. (i.e. the object cannot be dragged over or through other MovieClips).
function dragHolder01(event:Event):void{
if (mouseDownHolder01 == true) {
for(var m:int = 0;m<blockHolder.numChildren; m++){
[code].....
I'm trying to have an enemy's shell hit my player. I have the logic in place that detects a player's bomb hit an enemy, I tried to edit it slightly and apply the same logic to the enemies shell.
Code:
// check for collisionspublic function checkHits(event:Event)
{
[code]......
How do I clean up after I've finished using the Camera object and Video Object?
Do I just write:
_cameraInstance = null;
_videoInstance = null;
I am making my second flash game, I am still very much a beginner. This time i am trying to make a platformer in the style of fancy pants adventure. To do this i obviously need to make the camera follow my character. The problem is; i simply don't know how. I have yet to find a CS5 compatible solution with my less than good google skills, and so here I am.
View 6 RepliesI am creating a game where I have two separate arrays of objects that I need hitTested with each other. I found an old tutorial in AS2 that I modified to come up with this code:
ActionScript Code:
for (var w:Number = 0;w < enemyLaserArray.length;w++) {
for (var R:Number = 0;R < barricade1Array.length-1;R++) {
if (enemyLaserArray[w].hitTestObject(barricade1Array[R])) {
[code]....
This code executes like I believe it should, but along with removing the two objects, and splicing them from their arrays, I get this error
Code:
TypeError: Error #1010: A term is undefined and has no properties.on the line hitTestObject line. I have had similar problems in other areas of my project, but this time no matter what I try using trace statements I cannot fathom quite what the problem is.
I've attached a zip with a few custom classes and a .FLA. Ignore the custom classes. I'm getting repeated
"Error #1009: Cannot access a property or method of a null object reference. at Environment_fla::MainTimeline/hitTest()".
I understand that this error means I'm asking it to reference something that's no longer there. How better to hitTest many objects in an array. My game involves creating a bunch of balls that will fall into buckets. I need to keep track of how many touched the buckets, how many fell off the screen, and remove each accordingly.
Here is the code from my main FLA
ActionScript Code:
var ballTimer:Timer = new Timer(200);
var changeTimer:Timer = new Timer(50000);
ballTimer.addEventListener(TimerEvent.TIMER, throwBall, false, 0, true);
ballTimer.start();
changeTimer.addEventListener(TimerEvent.TIMER, changeColor);
changeTimer.start();
[Code] .....
I am capturing camera on flex for android using air 3.1,and found that the camera is only showing the a part of of actual camera video.When i view camera using normal camera application in android galaxy tab, it shows full camera area but when i am capturing the camera in flex its showing only the center area for it.I tried using setMode to set the resolution, but its not of any use.Is there any way to get full camera area captured inside flex using camera.getCamera ?
View 1 RepliesI have a video capture device on a machine. I have written a windows application to capture the video from this device. While capturing, if i try to broadcast using flash it does not connect. If i'm already broadcasting and then try to capture then my windows application does not get the capture pin of the device. So, flash seems to be taking the capture pin. Is there anyway to broadcast using the preview pin on the device so that i can capture using my application. Or is there way where i can split the capture pin and give one to my app and one to the broadcaster
View 10 RepliesI am trying to traverse object tree in AFL (adobe flash lite) engine, to check if there are memory leaks in an event driven application (AS3). The idea is to get object tree dump before and after an event processing and check the object tree dump difference for memory leaks.I believe MMgc is the GC for AFL, I am unable to get a dump of object tree, can anyone help me to point out where in code I can get the alive object info in tamarin.
View 1 Replieshow 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,
View 4 RepliesI have almost everything working except for collision with the bricks. This is based heavily off the "Flash Games University" example although several things are changed. When the game starts with brick collection detection in play, and the ball appears the entire thing freezes. I get this error: Error #1009: Cannot access a property or method of a null object reference. It repeats 28 times - the number of bricks. The error seems to be occurring at "var brickRect:Rectangle", according to debug and observing. It may be a scope issue, but what should I change to fix?
[Code]....
I am using the Camera on Flash, but when I finish to use, now can I "destroy" the camera object for improve the application performance?
private var camera_atual:Camera = Camera.getCamera();
private var video_camera:Video = new Video(820, 546);
camera_atual.setQuality(0,100);
camera_atual.setMode(550,480,30,true);
video_camera.attachCamera(camera_atual);
this.palco_mc.addChild(video_camera);
What should I look for when buying a video camera to record videos that could be used with Flacs?
View 1 RepliesIs there any other way to access the camera using ActionScript 3 other than
import flash.media.Camera;
videoInstance.attachCamera(cameraInstance);
Or should I use any API s? If so, any API suitable and some tutorials if possible.
is it possible to move the 'camera' around in flash (cs4 as3) as apposed to moving the scene around it?
View 2 RepliesI 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 Repliesi have a snake game that uses a timer to incremement the snakes size, and ive been trying to figure out hit detection on it. and have got to this stage
for (var i = 1; i < snake.length; i++){ //this is where I am trying to make the hit
if (Math.floor(snake[0].x) == Math.floor(s.x) && Math.floor(snake[0].y) == Math.floor(s.y) ){
[code]....