Re: [Flashcoders] webcam wackiness...

2011-09-20 Thread tom rhodes
ok, here is the most basic webcam script in the world as provided by cedric
:)

http://46.4.226.29/camtest/flash9/

this does not work in chrome v 14 on a pc or on a host of macs.

anyone?

On 19 September 2011 16:05, tom rhodes tom.rho...@gmail.com wrote:

 anyone got any ideas why this script is failing on so many machines?


 2011/9/19 Cédric Muller flashco...@benga.li

 yes, it works

  ok cheers for the testing, does the simple script work for you in a
 browser?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  I don't have GoogleTalk plugin, actually I am not Google wavy, so I
 have
  nothing 'Google' on my mac. I don't even have Chrome installed. Just
 tested
  in Safari and it didn't work.
  I do get the same 'camera.muted' status with Safari (no dialog, just a
  blank white screen)
 
  always living across the border, under the mountains :) but had a baby,
 a
  baby from the mountains ;)
 
  yeah started with basic code like that, you on a mac with googletalk
  plugin
  installed? i think it may have something to do with that. if you look
 at
  my
  code the actual attahcing of the camera is the same. on chrome 14 i
 get
  one
  Camera.muted from teh status event and then nothing. no dialog or
  anything.
  same behaviour being reported on macs (not got one here).
 
  just outside rome these days man, you across the border in the
 mountains
  still?
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  hey ya tom!
 
  still does not work :(
 
  did you try the following overbasic code ? (works here)
 
  var video:Video = new Video(640, 480);
  var camera:Camera = Camera.getCamera();
  camera.setMode(640, 480, 30);
  video.attachCamera(camera);
  addChild(video);
 
  hth,
  Cedric
 
  ps: still in Roma ?
 
  http://46.4.226.29/camtest/
 
  updated to include a dropdown of all camera's on the system, and a
  button
  to
  kick them off with.
 
  right now, if it only finds one camera it will attempt to attach it,
 if
  it
  finds more than one it will wait for you to select which one you
 want
  to
  use
  and then click start webcam button.
 
  this fails for me in chrome v 14, and i'm told on a mac in any
 browser.
  source below...
 
  package
  {
  import fl.controls.Button;
  import fl.controls.ComboBox;
  import fl.data.DataProvider;
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
  import flash.external.ExternalInterface;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  private var combo:ComboBox;
  private var dp:DataProvider;
  private var butt:Button;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.INIT, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  combo = new ComboBox();
  combo.prompt = Select a webcam...;
  dp = new DataProvider();
  var camList:Array = Camera.names;
  for (var i:int = 0; i  camList.length; i++)
  {
  var camName:String = camList[i];
  dp.addItemAt( { label:camName, data:String(i) }, i );
  /*if (camName.indexOf(Google)  -1)
  {
  var googleCam:Camera = Camera.getCamera(i.toString())
  googleCam.setMode(400, 300, 30, false);
  var vid:Video = new Video(cam.width, cam.height);
  vid.attachCamera(googleCam);
  }*/
  }
  addChild(combo);
  combo.x = 10;
  combo.y = 10;
  combo.width = 150;
  combo.dataProvider = dp;
  combo.addEventListener(Event.CHANGE, comboSelected);
  if (dp.length == 1) attachCamera(0);
  butt = new Button();
  butt.y = combo.y;
  butt.x = combo.x + combo.width + 15;
  butt.label = Start Webcam;
  butt.width = 100;
  addChild(butt);
  }
  private function comboSelected(e:Event):void
  {
  butt.addEventListener(MouseEvent.CLICK, buttClicked);
  }
  private function buttClicked(e:MouseEvent):void
  {
  cam.removeEventListener(StatusEvent.STATUS, startcam);
  cam = null;
  removeChild(video);
  video = null;
  attachCamera(combo.selectedItem.data);
  }
  private function attachCamera(camIndex:String):void
  {
  cam = Camera.getCamera(camIndex);
   if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  video.y = 50;
  video.x = 10;
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  if (ExternalInterface.available) ExternalInterface.call(alert,
  event.toString());
  }
  }
  }
 
  On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com
 wrote:
 
  hey cedric if you've got code that you think 100% works on
 everything
  send
  it on and i'll put it up on the link. i thought that too :)
 
  after googling i've found stuff about looping through character
 names
  and
  attaching google cameras to video objects offstage, or pulling out
 the
  name
  

Re: [Flashcoders] webcam wackiness...

2011-09-20 Thread Cédric Muller
ok, I found something :)

Does not work:
http://46.4.226.29/camtest/flash9/

Works:
http://46.4.226.29/camtest/flash9/camflash9.swf

Difference: HTML / JS / Detection havok

hth,
Cedric

HTML 99% bad :P

 ok, here is the most basic webcam script in the world as provided by cedric
 :)
 
 http://46.4.226.29/camtest/flash9/
 
 this does not work in chrome v 14 on a pc or on a host of macs.
 
 anyone?
 
 On 19 September 2011 16:05, tom rhodes tom.rho...@gmail.com wrote:
 
 anyone got any ideas why this script is failing on so many machines?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 yes, it works
 
 ok cheers for the testing, does the simple script work for you in a
 browser?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 I don't have GoogleTalk plugin, actually I am not Google wavy, so I
 have
 nothing 'Google' on my mac. I don't even have Chrome installed. Just
 tested
 in Safari and it didn't work.
 I do get the same 'camera.muted' status with Safari (no dialog, just a
 blank white screen)
 
 always living across the border, under the mountains :) but had a baby,
 a
 baby from the mountains ;)
 
 yeah started with basic code like that, you on a mac with googletalk
 plugin
 installed? i think it may have something to do with that. if you look
 at
 my
 code the actual attahcing of the camera is the same. on chrome 14 i
 get
 one
 Camera.muted from teh status event and then nothing. no dialog or
 anything.
 same behaviour being reported on macs (not got one here).
 
 just outside rome these days man, you across the border in the
 mountains
 still?
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 hey ya tom!
 
 still does not work :(
 
 did you try the following overbasic code ? (works here)
 
 var video:Video = new Video(640, 480);
 var camera:Camera = Camera.getCamera();
 camera.setMode(640, 480, 30);
 video.attachCamera(camera);
 addChild(video);
 
 hth,
 Cedric
 
 ps: still in Roma ?
 
 http://46.4.226.29/camtest/
 
 updated to include a dropdown of all camera's on the system, and a
 button
 to
 kick them off with.
 
 right now, if it only finds one camera it will attempt to attach it,
 if
 it
 finds more than one it will wait for you to select which one you
 want
 to
 use
 and then click start webcam button.
 
 this fails for me in chrome v 14, and i'm told on a mac in any
 browser.
 source below...
 
 package
 {
 import fl.controls.Button;
 import fl.controls.ComboBox;
 import fl.data.DataProvider;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.events.StatusEvent;
 import flash.external.ExternalInterface;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 private var combo:ComboBox;
 private var dp:DataProvider;
 private var butt:Button;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.INIT, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 combo = new ComboBox();
 combo.prompt = Select a webcam...;
 dp = new DataProvider();
 var camList:Array = Camera.names;
 for (var i:int = 0; i  camList.length; i++)
 {
 var camName:String = camList[i];
 dp.addItemAt( { label:camName, data:String(i) }, i );
 /*if (camName.indexOf(Google)  -1)
 {
 var googleCam:Camera = Camera.getCamera(i.toString())
 googleCam.setMode(400, 300, 30, false);
 var vid:Video = new Video(cam.width, cam.height);
 vid.attachCamera(googleCam);
 }*/
 }
 addChild(combo);
 combo.x = 10;
 combo.y = 10;
 combo.width = 150;
 combo.dataProvider = dp;
 combo.addEventListener(Event.CHANGE, comboSelected);
 if (dp.length == 1) attachCamera(0);
 butt = new Button();
 butt.y = combo.y;
 butt.x = combo.x + combo.width + 15;
 butt.label = Start Webcam;
 butt.width = 100;
 addChild(butt);
 }
 private function comboSelected(e:Event):void
 {
 butt.addEventListener(MouseEvent.CLICK, buttClicked);
 }
 private function buttClicked(e:MouseEvent):void
 {
 cam.removeEventListener(StatusEvent.STATUS, startcam);
 cam = null;
 removeChild(video);
 video = null;
 attachCamera(combo.selectedItem.data);
 }
 private function attachCamera(camIndex:String):void
 {
 cam = Camera.getCamera(camIndex);
 if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 video.y = 50;
 video.x = 10;
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 if (ExternalInterface.available) ExternalInterface.call(alert,
 event.toString());
 }
 }
 }
 
 On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com
 wrote:
 
 hey cedric if you've got code that you think 100% works on
 everything
 send
 it on and i'll put it up on the link. i thought that too :)
 
 after googling i've found stuff about looping through character
 names
 and
 

Re: [Flashcoders] webcam wackiness...

2011-09-20 Thread tom rhodes
yeah this is terrible, this worked for years, anyone got a fix?

2011/9/20 Cédric Muller flashco...@benga.li

 ok, I found something :)

 Does not work:
 http://46.4.226.29/camtest/flash9/

 Works:
 http://46.4.226.29/camtest/flash9/camflash9.swf

 Difference: HTML / JS / Detection havok

 hth,
 Cedric

 HTML 99% bad :P

  ok, here is the most basic webcam script in the world as provided by
 cedric
  :)
 
  http://46.4.226.29/camtest/flash9/
 
  this does not work in chrome v 14 on a pc or on a host of macs.
 
  anyone?
 
  On 19 September 2011 16:05, tom rhodes tom.rho...@gmail.com wrote:
 
  anyone got any ideas why this script is failing on so many machines?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  yes, it works
 
  ok cheers for the testing, does the simple script work for you in a
  browser?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  I don't have GoogleTalk plugin, actually I am not Google wavy, so I
  have
  nothing 'Google' on my mac. I don't even have Chrome installed. Just
  tested
  in Safari and it didn't work.
  I do get the same 'camera.muted' status with Safari (no dialog, just
 a
  blank white screen)
 
  always living across the border, under the mountains :) but had a
 baby,
  a
  baby from the mountains ;)
 
  yeah started with basic code like that, you on a mac with googletalk
  plugin
  installed? i think it may have something to do with that. if you
 look
  at
  my
  code the actual attahcing of the camera is the same. on chrome 14 i
  get
  one
  Camera.muted from teh status event and then nothing. no dialog or
  anything.
  same behaviour being reported on macs (not got one here).
 
  just outside rome these days man, you across the border in the
  mountains
  still?
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  hey ya tom!
 
  still does not work :(
 
  did you try the following overbasic code ? (works here)
 
  var video:Video = new Video(640, 480);
  var camera:Camera = Camera.getCamera();
  camera.setMode(640, 480, 30);
  video.attachCamera(camera);
  addChild(video);
 
  hth,
  Cedric
 
  ps: still in Roma ?
 
  http://46.4.226.29/camtest/
 
  updated to include a dropdown of all camera's on the system, and a
  button
  to
  kick them off with.
 
  right now, if it only finds one camera it will attempt to attach
 it,
  if
  it
  finds more than one it will wait for you to select which one you
  want
  to
  use
  and then click start webcam button.
 
  this fails for me in chrome v 14, and i'm told on a mac in any
  browser.
  source below...
 
  package
  {
  import fl.controls.Button;
  import fl.controls.ComboBox;
  import fl.data.DataProvider;
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
  import flash.external.ExternalInterface;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  private var combo:ComboBox;
  private var dp:DataProvider;
  private var butt:Button;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.INIT, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  combo = new ComboBox();
  combo.prompt = Select a webcam...;
  dp = new DataProvider();
  var camList:Array = Camera.names;
  for (var i:int = 0; i  camList.length; i++)
  {
  var camName:String = camList[i];
  dp.addItemAt( { label:camName, data:String(i) }, i );
  /*if (camName.indexOf(Google)  -1)
  {
  var googleCam:Camera = Camera.getCamera(i.toString())
  googleCam.setMode(400, 300, 30, false);
  var vid:Video = new Video(cam.width, cam.height);
  vid.attachCamera(googleCam);
  }*/
  }
  addChild(combo);
  combo.x = 10;
  combo.y = 10;
  combo.width = 150;
  combo.dataProvider = dp;
  combo.addEventListener(Event.CHANGE, comboSelected);
  if (dp.length == 1) attachCamera(0);
  butt = new Button();
  butt.y = combo.y;
  butt.x = combo.x + combo.width + 15;
  butt.label = Start Webcam;
  butt.width = 100;
  addChild(butt);
  }
  private function comboSelected(e:Event):void
  {
  butt.addEventListener(MouseEvent.CLICK, buttClicked);
  }
  private function buttClicked(e:MouseEvent):void
  {
  cam.removeEventListener(StatusEvent.STATUS, startcam);
  cam = null;
  removeChild(video);
  video = null;
  attachCamera(combo.selectedItem.data);
  }
  private function attachCamera(camIndex:String):void
  {
  cam = Camera.getCamera(camIndex);
  if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  video.y = 50;
  video.x = 10;
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  if (ExternalInterface.available) ExternalInterface.call(alert,
  event.toString());
  }
  }
  }
 
  On 19 September 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Dave Watts
 I recently developing an AR apps and my clients also face the same problem.
 I asked them to update their flash player to 10.3.183.7

 Check MAC flash player version by visiting the page -
 http://www.adobe.com/software/flash/about/

I'm using the latest FP version, and Tom's link didn't work for me.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Deepanjan Das
Hi Tom,
I used the code for web camera below and the latest version of flash player
- 10.3.183.7:

private function showCameraLists():void
{
var cam:Camera = Camera.getCamera();
if(cam == null){
ExternalInterface.call('alert', No Web Camera found!);
return;
}
var camNames:Array = Camera.names;
var index:Number = 0;
for ( var i : int = 0 ; i  camNames.length ; i++ ) {
if (camNames[i] == USB Video Class Video ) {
index = i;
}
}
if(index  0){
createCamera(index.toString());
}else{
createCamera();
}
}

private function createCamera( cameraIndex:String=null ):void
{
webcam = Camera.getCamera( cameraIndex );
webcam.setMode( cameraWidth, cameraHeight, cameraFrameRate, true
);
webcam.setMotionLevel(70, 2000);

webcam.addEventListener( ActivityEvent.ACTIVITY,
onCameraActivity, false, 0, true );
webcam.addEventListener( StatusEvent.STATUS, onCameraStatus );

videoMatrix = new Matrix();
videoMatrix.a = -1; // scale(-1, 0); // flip horizontal assuming
that scaleX is currently 1
videoMatrix.tx = this.cameraWidth;

video = new Video( webcam.width, webcam.height );
video.attachCamera( webcam );
}


Warm Regards
Deepanjan Das
W: http://deepanjandas.wordpress.com
|| Om Manasamarthadata Shri Aniruddhaya Namah
||http://www.manasamarthyadata.com/
*Think of the environment before printing this email
__
*



On Mon, Sep 19, 2011 at 12:16 PM, Dave Watts dwa...@figleaf.com wrote:

  I recently developing an AR apps and my clients also face the same
 problem.
  I asked them to update their flash player to 10.3.183.7
 
  Check MAC flash player version by visiting the page -
  http://www.adobe.com/software/flash/about/

 I'm using the latest FP version, and Tom's link didn't work for me.

 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Cédric Muller
Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14

Could you drop the 'if (stage) init' line ?

(I am asking because I have plenty of webcam examples, and they do work)

hth,
Cedric

 hey all,
 
 i want to confirm that this...
 
 http://46.4.226.29/camtest/
 
 does not work on a mac, and in chrome 14 beta on the pc? massively simple
 webcam example, source below...
 
 code
 package
 {
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.StatusEvent;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.ADDED_TO_STAGE, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 cam = Camera.getCamera();
if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 // stuff
 }
 }
 }
 /code
 
 i've NEVER experienced probs with webcam before, what is going on here?
 
 tom.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread tom rhodes
hey cedric if you've got code that you think 100% works on everything send
it on and i'll put it up on the link. i thought that too :)

after googling i've found stuff about looping through character names and
attaching google cameras to video objects offstage, or pulling out the name
for the usb cam on a mac if on mac OS, or even just using index 2 for the
mac. all seem a bit hacky to me. this is somethign that has worked in flash
fine for a LONG time, that now appears to be broken. what's up?

2011/9/19 Cédric Muller flashco...@benga.li

 Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14

 Could you drop the 'if (stage) init' line ?

 (I am asking because I have plenty of webcam examples, and they do work)

 hth,
 Cedric

  hey all,
 
  i want to confirm that this...
 
  http://46.4.226.29/camtest/
 
  does not work on a mac, and in chrome 14 beta on the pc? massively simple
  webcam example, source below...
 
  code
  package
  {
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.StatusEvent;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.ADDED_TO_STAGE, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  cam = Camera.getCamera();
 if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  // stuff
  }
  }
  }
  /code
 
  i've NEVER experienced probs with webcam before, what is going on here?
 
  tom.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread tom rhodes
http://46.4.226.29/camtest/

updated to include a dropdown of all camera's on the system, and a button to
kick them off with.

right now, if it only finds one camera it will attempt to attach it, if it
finds more than one it will wait for you to select which one you want to use
and then click start webcam button.

this fails for me in chrome v 14, and i'm told on a mac in any browser.
source below...

package
{
import fl.controls.Button;
 import fl.controls.ComboBox;
import fl.data.DataProvider;
import flash.display.Sprite;
 import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.StatusEvent;
 import flash.external.ExternalInterface;
import flash.media.Camera;
import flash.media.Video;

public class Main extends Sprite
{
private var cam:Camera;
 private var video:Video;
private var combo:ComboBox;
private var dp:DataProvider;
 private var butt:Button;
 public function Main():void
 {
if (stage) init();
else addEventListener(Event.INIT, init);
 }
 private function init(e:Event = null):void
 {
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
 combo = new ComboBox();
combo.prompt = Select a webcam...;
 dp = new DataProvider();
var camList:Array = Camera.names;
for (var i:int = 0; i  camList.length; i++)
 {
var camName:String = camList[i];
dp.addItemAt( { label:camName, data:String(i) }, i );
 /*if (camName.indexOf(Google)  -1)
{
var googleCam:Camera = Camera.getCamera(i.toString())
 googleCam.setMode(400, 300, 30, false);
var vid:Video = new Video(cam.width, cam.height);
 vid.attachCamera(googleCam);
}*/
}
 addChild(combo);
combo.x = 10;
combo.y = 10;
 combo.width = 150;
combo.dataProvider = dp;
combo.addEventListener(Event.CHANGE, comboSelected);
 if (dp.length == 1) attachCamera(0);
butt = new Button();
 butt.y = combo.y;
butt.x = combo.x + combo.width + 15;
butt.label = Start Webcam;
 butt.width = 100;
addChild(butt);
}
 private function comboSelected(e:Event):void
{
 butt.addEventListener(MouseEvent.CLICK, buttClicked);
}
 private function buttClicked(e:MouseEvent):void
{
cam.removeEventListener(StatusEvent.STATUS, startcam);
 cam = null;
removeChild(video);
video = null;
 attachCamera(combo.selectedItem.data);
}
 private function attachCamera(camIndex:String):void
{
cam = Camera.getCamera(camIndex);
if (cam != null) {
//cam.setMode(320, 240, 30, false);
cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
video.attachCamera(cam);
video.y = 50;
 video.x = 10;
cam.addEventListener(StatusEvent.STATUS, startcam);
addChild(video);
 }
}
 private function startcam(event:StatusEvent):void {
if (ExternalInterface.available) ExternalInterface.call(alert,
event.toString());
 }
 }
 }

On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:

 hey cedric if you've got code that you think 100% works on everything send
 it on and i'll put it up on the link. i thought that too :)

 after googling i've found stuff about looping through character names and
 attaching google cameras to video objects offstage, or pulling out the name
 for the usb cam on a mac if on mac OS, or even just using index 2 for the
 mac. all seem a bit hacky to me. this is somethign that has worked in flash
 fine for a LONG time, that now appears to be broken. what's up?


 2011/9/19 Cédric Muller flashco...@benga.li

 Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14

 Could you drop the 'if (stage) init' line ?

 (I am asking because I have plenty of webcam examples, and they do work)

 hth,
 Cedric

  hey all,
 
  i want to confirm that this...
 
  http://46.4.226.29/camtest/
 
  does not work on a mac, and in chrome 14 beta on the pc? massively
 simple
  webcam example, source below...
 
  code
  package
  {
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.StatusEvent;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.ADDED_TO_STAGE, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  cam = Camera.getCamera();
 if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  // stuff
  }
  }
  }
  /code
 
  i've NEVER experienced probs with webcam before, what is going on here?
 
  tom.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Cédric Muller
hey ya tom!

still does not work :(

did you try the following overbasic code ? (works here)

var video:Video = new Video(640, 480);
var camera:Camera = Camera.getCamera();
camera.setMode(640, 480, 30);
video.attachCamera(camera);
addChild(video);

hth,
Cedric

ps: still in Roma ?

 http://46.4.226.29/camtest/
 
 updated to include a dropdown of all camera's on the system, and a button to
 kick them off with.
 
 right now, if it only finds one camera it will attempt to attach it, if it
 finds more than one it will wait for you to select which one you want to use
 and then click start webcam button.
 
 this fails for me in chrome v 14, and i'm told on a mac in any browser.
 source below...
 
 package
 {
 import fl.controls.Button;
 import fl.controls.ComboBox;
 import fl.data.DataProvider;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.events.StatusEvent;
 import flash.external.ExternalInterface;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 private var combo:ComboBox;
 private var dp:DataProvider;
 private var butt:Button;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.INIT, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 combo = new ComboBox();
 combo.prompt = Select a webcam...;
 dp = new DataProvider();
 var camList:Array = Camera.names;
 for (var i:int = 0; i  camList.length; i++)
 {
 var camName:String = camList[i];
 dp.addItemAt( { label:camName, data:String(i) }, i );
 /*if (camName.indexOf(Google)  -1)
 {
 var googleCam:Camera = Camera.getCamera(i.toString())
 googleCam.setMode(400, 300, 30, false);
 var vid:Video = new Video(cam.width, cam.height);
 vid.attachCamera(googleCam);
 }*/
 }
 addChild(combo);
 combo.x = 10;
 combo.y = 10;
 combo.width = 150;
 combo.dataProvider = dp;
 combo.addEventListener(Event.CHANGE, comboSelected);
 if (dp.length == 1) attachCamera(0);
 butt = new Button();
 butt.y = combo.y;
 butt.x = combo.x + combo.width + 15;
 butt.label = Start Webcam;
 butt.width = 100;
 addChild(butt);
 }
 private function comboSelected(e:Event):void
 {
 butt.addEventListener(MouseEvent.CLICK, buttClicked);
 }
 private function buttClicked(e:MouseEvent):void
 {
 cam.removeEventListener(StatusEvent.STATUS, startcam);
 cam = null;
 removeChild(video);
 video = null;
 attachCamera(combo.selectedItem.data);
 }
 private function attachCamera(camIndex:String):void
 {
 cam = Camera.getCamera(camIndex);
if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 video.y = 50;
 video.x = 10;
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 if (ExternalInterface.available) ExternalInterface.call(alert,
 event.toString());
 }
 }
 }
 
 On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
 hey cedric if you've got code that you think 100% works on everything send
 it on and i'll put it up on the link. i thought that too :)
 
 after googling i've found stuff about looping through character names and
 attaching google cameras to video objects offstage, or pulling out the name
 for the usb cam on a mac if on mac OS, or even just using index 2 for the
 mac. all seem a bit hacky to me. this is somethign that has worked in flash
 fine for a LONG time, that now appears to be broken. what's up?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14
 
 Could you drop the 'if (stage) init' line ?
 
 (I am asking because I have plenty of webcam examples, and they do work)
 
 hth,
 Cedric
 
 hey all,
 
 i want to confirm that this...
 
 http://46.4.226.29/camtest/
 
 does not work on a mac, and in chrome 14 beta on the pc? massively
 simple
 webcam example, source below...
 
 code
 package
 {
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.StatusEvent;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.ADDED_TO_STAGE, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 cam = Camera.getCamera();
   if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 // stuff
 }
 }
 }
 /code
 
 i've NEVER experienced probs with webcam before, what is going on here?
 
 tom.
 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread tom rhodes
yeah started with basic code like that, you on a mac with googletalk plugin
installed? i think it may have something to do with that. if you look at my
code the actual attahcing of the camera is the same. on chrome 14 i get one
Camera.muted from teh status event and then nothing. no dialog or anything.
same behaviour being reported on macs (not got one here).

just outside rome these days man, you across the border in the mountains
still?

2011/9/19 Cédric Muller flashco...@benga.li

 hey ya tom!

 still does not work :(

 did you try the following overbasic code ? (works here)

 var video:Video = new Video(640, 480);
 var camera:Camera = Camera.getCamera();
 camera.setMode(640, 480, 30);
 video.attachCamera(camera);
 addChild(video);

 hth,
 Cedric

 ps: still in Roma ?

  http://46.4.226.29/camtest/
 
  updated to include a dropdown of all camera's on the system, and a button
 to
  kick them off with.
 
  right now, if it only finds one camera it will attempt to attach it, if
 it
  finds more than one it will wait for you to select which one you want to
 use
  and then click start webcam button.
 
  this fails for me in chrome v 14, and i'm told on a mac in any browser.
  source below...
 
  package
  {
  import fl.controls.Button;
  import fl.controls.ComboBox;
  import fl.data.DataProvider;
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
  import flash.external.ExternalInterface;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  private var combo:ComboBox;
  private var dp:DataProvider;
  private var butt:Button;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.INIT, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  combo = new ComboBox();
  combo.prompt = Select a webcam...;
  dp = new DataProvider();
  var camList:Array = Camera.names;
  for (var i:int = 0; i  camList.length; i++)
  {
  var camName:String = camList[i];
  dp.addItemAt( { label:camName, data:String(i) }, i );
  /*if (camName.indexOf(Google)  -1)
  {
  var googleCam:Camera = Camera.getCamera(i.toString())
  googleCam.setMode(400, 300, 30, false);
  var vid:Video = new Video(cam.width, cam.height);
  vid.attachCamera(googleCam);
  }*/
  }
  addChild(combo);
  combo.x = 10;
  combo.y = 10;
  combo.width = 150;
  combo.dataProvider = dp;
  combo.addEventListener(Event.CHANGE, comboSelected);
  if (dp.length == 1) attachCamera(0);
  butt = new Button();
  butt.y = combo.y;
  butt.x = combo.x + combo.width + 15;
  butt.label = Start Webcam;
  butt.width = 100;
  addChild(butt);
  }
  private function comboSelected(e:Event):void
  {
  butt.addEventListener(MouseEvent.CLICK, buttClicked);
  }
  private function buttClicked(e:MouseEvent):void
  {
  cam.removeEventListener(StatusEvent.STATUS, startcam);
  cam = null;
  removeChild(video);
  video = null;
  attachCamera(combo.selectedItem.data);
  }
  private function attachCamera(camIndex:String):void
  {
  cam = Camera.getCamera(camIndex);
 if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  video.y = 50;
  video.x = 10;
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  if (ExternalInterface.available) ExternalInterface.call(alert,
  event.toString());
  }
  }
  }
 
  On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
  hey cedric if you've got code that you think 100% works on everything
 send
  it on and i'll put it up on the link. i thought that too :)
 
  after googling i've found stuff about looping through character names
 and
  attaching google cameras to video objects offstage, or pulling out the
 name
  for the usb cam on a mac if on mac OS, or even just using index 2 for
 the
  mac. all seem a bit hacky to me. this is somethign that has worked in
 flash
  fine for a LONG time, that now appears to be broken. what's up?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14
 
  Could you drop the 'if (stage) init' line ?
 
  (I am asking because I have plenty of webcam examples, and they do
 work)
 
  hth,
  Cedric
 
  hey all,
 
  i want to confirm that this...
 
  http://46.4.226.29/camtest/
 
  does not work on a mac, and in chrome 14 beta on the pc? massively
  simple
  webcam example, source below...
 
  code
  package
  {
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.StatusEvent;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  public function Main():void
  

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Cédric Muller
I don't have GoogleTalk plugin, actually I am not Google wavy, so I have 
nothing 'Google' on my mac. I don't even have Chrome installed. Just tested in 
Safari and it didn't work.
I do get the same 'camera.muted' status with Safari (no dialog, just a blank 
white screen)

always living across the border, under the mountains :) but had a baby, a baby 
from the mountains ;)

 yeah started with basic code like that, you on a mac with googletalk plugin
 installed? i think it may have something to do with that. if you look at my
 code the actual attahcing of the camera is the same. on chrome 14 i get one
 Camera.muted from teh status event and then nothing. no dialog or anything.
 same behaviour being reported on macs (not got one here).
 
 just outside rome these days man, you across the border in the mountains
 still?
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 hey ya tom!
 
 still does not work :(
 
 did you try the following overbasic code ? (works here)
 
 var video:Video = new Video(640, 480);
 var camera:Camera = Camera.getCamera();
 camera.setMode(640, 480, 30);
 video.attachCamera(camera);
 addChild(video);
 
 hth,
 Cedric
 
 ps: still in Roma ?
 
 http://46.4.226.29/camtest/
 
 updated to include a dropdown of all camera's on the system, and a button
 to
 kick them off with.
 
 right now, if it only finds one camera it will attempt to attach it, if
 it
 finds more than one it will wait for you to select which one you want to
 use
 and then click start webcam button.
 
 this fails for me in chrome v 14, and i'm told on a mac in any browser.
 source below...
 
 package
 {
 import fl.controls.Button;
 import fl.controls.ComboBox;
 import fl.data.DataProvider;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.events.StatusEvent;
 import flash.external.ExternalInterface;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 private var combo:ComboBox;
 private var dp:DataProvider;
 private var butt:Button;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.INIT, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 combo = new ComboBox();
 combo.prompt = Select a webcam...;
 dp = new DataProvider();
 var camList:Array = Camera.names;
 for (var i:int = 0; i  camList.length; i++)
 {
 var camName:String = camList[i];
 dp.addItemAt( { label:camName, data:String(i) }, i );
 /*if (camName.indexOf(Google)  -1)
 {
 var googleCam:Camera = Camera.getCamera(i.toString())
 googleCam.setMode(400, 300, 30, false);
 var vid:Video = new Video(cam.width, cam.height);
 vid.attachCamera(googleCam);
 }*/
 }
 addChild(combo);
 combo.x = 10;
 combo.y = 10;
 combo.width = 150;
 combo.dataProvider = dp;
 combo.addEventListener(Event.CHANGE, comboSelected);
 if (dp.length == 1) attachCamera(0);
 butt = new Button();
 butt.y = combo.y;
 butt.x = combo.x + combo.width + 15;
 butt.label = Start Webcam;
 butt.width = 100;
 addChild(butt);
 }
 private function comboSelected(e:Event):void
 {
 butt.addEventListener(MouseEvent.CLICK, buttClicked);
 }
 private function buttClicked(e:MouseEvent):void
 {
 cam.removeEventListener(StatusEvent.STATUS, startcam);
 cam = null;
 removeChild(video);
 video = null;
 attachCamera(combo.selectedItem.data);
 }
 private function attachCamera(camIndex:String):void
 {
 cam = Camera.getCamera(camIndex);
   if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 video.y = 50;
 video.x = 10;
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 if (ExternalInterface.available) ExternalInterface.call(alert,
 event.toString());
 }
 }
 }
 
 On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
 hey cedric if you've got code that you think 100% works on everything
 send
 it on and i'll put it up on the link. i thought that too :)
 
 after googling i've found stuff about looping through character names
 and
 attaching google cameras to video objects offstage, or pulling out the
 name
 for the usb cam on a mac if on mac OS, or even just using index 2 for
 the
 mac. all seem a bit hacky to me. this is somethign that has worked in
 flash
 fine for a LONG time, that now appears to be broken. what's up?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14
 
 Could you drop the 'if (stage) init' line ?
 
 (I am asking because I have plenty of webcam examples, and they do
 work)
 
 hth,
 Cedric
 
 hey all,
 
 i want to confirm that this...
 
 http://46.4.226.29/camtest/
 
 does not work on a mac, and in chrome 14 beta on the pc? massively
 simple
 webcam example, source below...
 
 code
 package
 {
 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread tom rhodes
ok cheers for the testing, does the simple script work for you in a browser?


2011/9/19 Cédric Muller flashco...@benga.li

 I don't have GoogleTalk plugin, actually I am not Google wavy, so I have
 nothing 'Google' on my mac. I don't even have Chrome installed. Just tested
 in Safari and it didn't work.
 I do get the same 'camera.muted' status with Safari (no dialog, just a
 blank white screen)

 always living across the border, under the mountains :) but had a baby, a
 baby from the mountains ;)

  yeah started with basic code like that, you on a mac with googletalk
 plugin
  installed? i think it may have something to do with that. if you look at
 my
  code the actual attahcing of the camera is the same. on chrome 14 i get
 one
  Camera.muted from teh status event and then nothing. no dialog or
 anything.
  same behaviour being reported on macs (not got one here).
 
  just outside rome these days man, you across the border in the mountains
  still?
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  hey ya tom!
 
  still does not work :(
 
  did you try the following overbasic code ? (works here)
 
  var video:Video = new Video(640, 480);
  var camera:Camera = Camera.getCamera();
  camera.setMode(640, 480, 30);
  video.attachCamera(camera);
  addChild(video);
 
  hth,
  Cedric
 
  ps: still in Roma ?
 
  http://46.4.226.29/camtest/
 
  updated to include a dropdown of all camera's on the system, and a
 button
  to
  kick them off with.
 
  right now, if it only finds one camera it will attempt to attach it, if
  it
  finds more than one it will wait for you to select which one you want
 to
  use
  and then click start webcam button.
 
  this fails for me in chrome v 14, and i'm told on a mac in any browser.
  source below...
 
  package
  {
  import fl.controls.Button;
  import fl.controls.ComboBox;
  import fl.data.DataProvider;
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
  import flash.external.ExternalInterface;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  private var combo:ComboBox;
  private var dp:DataProvider;
  private var butt:Button;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.INIT, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  combo = new ComboBox();
  combo.prompt = Select a webcam...;
  dp = new DataProvider();
  var camList:Array = Camera.names;
  for (var i:int = 0; i  camList.length; i++)
  {
  var camName:String = camList[i];
  dp.addItemAt( { label:camName, data:String(i) }, i );
  /*if (camName.indexOf(Google)  -1)
  {
  var googleCam:Camera = Camera.getCamera(i.toString())
  googleCam.setMode(400, 300, 30, false);
  var vid:Video = new Video(cam.width, cam.height);
  vid.attachCamera(googleCam);
  }*/
  }
  addChild(combo);
  combo.x = 10;
  combo.y = 10;
  combo.width = 150;
  combo.dataProvider = dp;
  combo.addEventListener(Event.CHANGE, comboSelected);
  if (dp.length == 1) attachCamera(0);
  butt = new Button();
  butt.y = combo.y;
  butt.x = combo.x + combo.width + 15;
  butt.label = Start Webcam;
  butt.width = 100;
  addChild(butt);
  }
  private function comboSelected(e:Event):void
  {
  butt.addEventListener(MouseEvent.CLICK, buttClicked);
  }
  private function buttClicked(e:MouseEvent):void
  {
  cam.removeEventListener(StatusEvent.STATUS, startcam);
  cam = null;
  removeChild(video);
  video = null;
  attachCamera(combo.selectedItem.data);
  }
  private function attachCamera(camIndex:String):void
  {
  cam = Camera.getCamera(camIndex);
if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  video.y = 50;
  video.x = 10;
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  if (ExternalInterface.available) ExternalInterface.call(alert,
  event.toString());
  }
  }
  }
 
  On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
  hey cedric if you've got code that you think 100% works on everything
  send
  it on and i'll put it up on the link. i thought that too :)
 
  after googling i've found stuff about looping through character names
  and
  attaching google cameras to video objects offstage, or pulling out the
  name
  for the usb cam on a mac if on mac OS, or even just using index 2 for
  the
  mac. all seem a bit hacky to me. this is somethign that has worked in
  flash
  fine for a LONG time, that now appears to be broken. what's up?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14
 
  Could you drop the 'if (stage) init' line ?
 
  (I am asking because I have plenty 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread Cédric Muller
yes, it works

 ok cheers for the testing, does the simple script work for you in a browser?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 I don't have GoogleTalk plugin, actually I am not Google wavy, so I have
 nothing 'Google' on my mac. I don't even have Chrome installed. Just tested
 in Safari and it didn't work.
 I do get the same 'camera.muted' status with Safari (no dialog, just a
 blank white screen)
 
 always living across the border, under the mountains :) but had a baby, a
 baby from the mountains ;)
 
 yeah started with basic code like that, you on a mac with googletalk
 plugin
 installed? i think it may have something to do with that. if you look at
 my
 code the actual attahcing of the camera is the same. on chrome 14 i get
 one
 Camera.muted from teh status event and then nothing. no dialog or
 anything.
 same behaviour being reported on macs (not got one here).
 
 just outside rome these days man, you across the border in the mountains
 still?
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 hey ya tom!
 
 still does not work :(
 
 did you try the following overbasic code ? (works here)
 
 var video:Video = new Video(640, 480);
 var camera:Camera = Camera.getCamera();
 camera.setMode(640, 480, 30);
 video.attachCamera(camera);
 addChild(video);
 
 hth,
 Cedric
 
 ps: still in Roma ?
 
 http://46.4.226.29/camtest/
 
 updated to include a dropdown of all camera's on the system, and a
 button
 to
 kick them off with.
 
 right now, if it only finds one camera it will attempt to attach it, if
 it
 finds more than one it will wait for you to select which one you want
 to
 use
 and then click start webcam button.
 
 this fails for me in chrome v 14, and i'm told on a mac in any browser.
 source below...
 
 package
 {
 import fl.controls.Button;
 import fl.controls.ComboBox;
 import fl.data.DataProvider;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.events.StatusEvent;
 import flash.external.ExternalInterface;
 import flash.media.Camera;
 import flash.media.Video;
 
 public class Main extends Sprite
 {
 private var cam:Camera;
 private var video:Video;
 private var combo:ComboBox;
 private var dp:DataProvider;
 private var butt:Button;
 public function Main():void
 {
 if (stage) init();
 else addEventListener(Event.INIT, init);
 }
 private function init(e:Event = null):void
 {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
 combo = new ComboBox();
 combo.prompt = Select a webcam...;
 dp = new DataProvider();
 var camList:Array = Camera.names;
 for (var i:int = 0; i  camList.length; i++)
 {
 var camName:String = camList[i];
 dp.addItemAt( { label:camName, data:String(i) }, i );
 /*if (camName.indexOf(Google)  -1)
 {
 var googleCam:Camera = Camera.getCamera(i.toString())
 googleCam.setMode(400, 300, 30, false);
 var vid:Video = new Video(cam.width, cam.height);
 vid.attachCamera(googleCam);
 }*/
 }
 addChild(combo);
 combo.x = 10;
 combo.y = 10;
 combo.width = 150;
 combo.dataProvider = dp;
 combo.addEventListener(Event.CHANGE, comboSelected);
 if (dp.length == 1) attachCamera(0);
 butt = new Button();
 butt.y = combo.y;
 butt.x = combo.x + combo.width + 15;
 butt.label = Start Webcam;
 butt.width = 100;
 addChild(butt);
 }
 private function comboSelected(e:Event):void
 {
 butt.addEventListener(MouseEvent.CLICK, buttClicked);
 }
 private function buttClicked(e:MouseEvent):void
 {
 cam.removeEventListener(StatusEvent.STATUS, startcam);
 cam = null;
 removeChild(video);
 video = null;
 attachCamera(combo.selectedItem.data);
 }
 private function attachCamera(camIndex:String):void
 {
 cam = Camera.getCamera(camIndex);
  if (cam != null) {
 //cam.setMode(320, 240, 30, false);
 cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
 video.attachCamera(cam);
 video.y = 50;
 video.x = 10;
 cam.addEventListener(StatusEvent.STATUS, startcam);
 addChild(video);
 }
 }
 private function startcam(event:StatusEvent):void {
 if (ExternalInterface.available) ExternalInterface.call(alert,
 event.toString());
 }
 }
 }
 
 On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
 hey cedric if you've got code that you think 100% works on everything
 send
 it on and i'll put it up on the link. i thought that too :)
 
 after googling i've found stuff about looping through character names
 and
 attaching google cameras to video objects offstage, or pulling out the
 name
 for the usb cam on a mac if on mac OS, or even just using index 2 for
 the
 mac. all seem a bit hacky to me. this is somethign that has worked in
 flash
 fine for a LONG time, that now appears to be broken. what's up?
 
 
 2011/9/19 Cédric Muller flashco...@benga.li
 
 Doesn't work for me, Mac, Safari 5.1 and Flash Player 10.3.181.14
 
 Could you drop the 'if (stage) init' line ?
 
 (I am asking because I have plenty of webcam examples, and they do
 work)
 
 hth,
 Cedric
 
 hey all,
 
 i want to confirm that this...
 
 

Re: [Flashcoders] webcam wackiness...

2011-09-19 Thread tom rhodes
anyone got any ideas why this script is failing on so many machines?

2011/9/19 Cédric Muller flashco...@benga.li

 yes, it works

  ok cheers for the testing, does the simple script work for you in a
 browser?
 
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  I don't have GoogleTalk plugin, actually I am not Google wavy, so I have
  nothing 'Google' on my mac. I don't even have Chrome installed. Just
 tested
  in Safari and it didn't work.
  I do get the same 'camera.muted' status with Safari (no dialog, just a
  blank white screen)
 
  always living across the border, under the mountains :) but had a baby,
 a
  baby from the mountains ;)
 
  yeah started with basic code like that, you on a mac with googletalk
  plugin
  installed? i think it may have something to do with that. if you look
 at
  my
  code the actual attahcing of the camera is the same. on chrome 14 i get
  one
  Camera.muted from teh status event and then nothing. no dialog or
  anything.
  same behaviour being reported on macs (not got one here).
 
  just outside rome these days man, you across the border in the
 mountains
  still?
 
  2011/9/19 Cédric Muller flashco...@benga.li
 
  hey ya tom!
 
  still does not work :(
 
  did you try the following overbasic code ? (works here)
 
  var video:Video = new Video(640, 480);
  var camera:Camera = Camera.getCamera();
  camera.setMode(640, 480, 30);
  video.attachCamera(camera);
  addChild(video);
 
  hth,
  Cedric
 
  ps: still in Roma ?
 
  http://46.4.226.29/camtest/
 
  updated to include a dropdown of all camera's on the system, and a
  button
  to
  kick them off with.
 
  right now, if it only finds one camera it will attempt to attach it,
 if
  it
  finds more than one it will wait for you to select which one you want
  to
  use
  and then click start webcam button.
 
  this fails for me in chrome v 14, and i'm told on a mac in any
 browser.
  source below...
 
  package
  {
  import fl.controls.Button;
  import fl.controls.ComboBox;
  import fl.data.DataProvider;
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
  import flash.external.ExternalInterface;
  import flash.media.Camera;
  import flash.media.Video;
 
  public class Main extends Sprite
  {
  private var cam:Camera;
  private var video:Video;
  private var combo:ComboBox;
  private var dp:DataProvider;
  private var butt:Button;
  public function Main():void
  {
  if (stage) init();
  else addEventListener(Event.INIT, init);
  }
  private function init(e:Event = null):void
  {
  removeEventListener(Event.ADDED_TO_STAGE, init);
  // entry point
  combo = new ComboBox();
  combo.prompt = Select a webcam...;
  dp = new DataProvider();
  var camList:Array = Camera.names;
  for (var i:int = 0; i  camList.length; i++)
  {
  var camName:String = camList[i];
  dp.addItemAt( { label:camName, data:String(i) }, i );
  /*if (camName.indexOf(Google)  -1)
  {
  var googleCam:Camera = Camera.getCamera(i.toString())
  googleCam.setMode(400, 300, 30, false);
  var vid:Video = new Video(cam.width, cam.height);
  vid.attachCamera(googleCam);
  }*/
  }
  addChild(combo);
  combo.x = 10;
  combo.y = 10;
  combo.width = 150;
  combo.dataProvider = dp;
  combo.addEventListener(Event.CHANGE, comboSelected);
  if (dp.length == 1) attachCamera(0);
  butt = new Button();
  butt.y = combo.y;
  butt.x = combo.x + combo.width + 15;
  butt.label = Start Webcam;
  butt.width = 100;
  addChild(butt);
  }
  private function comboSelected(e:Event):void
  {
  butt.addEventListener(MouseEvent.CLICK, buttClicked);
  }
  private function buttClicked(e:MouseEvent):void
  {
  cam.removeEventListener(StatusEvent.STATUS, startcam);
  cam = null;
  removeChild(video);
  video = null;
  attachCamera(combo.selectedItem.data);
  }
  private function attachCamera(camIndex:String):void
  {
  cam = Camera.getCamera(camIndex);
   if (cam != null) {
  //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
  video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
  video.y = 50;
  video.x = 10;
  cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
  }
  }
  private function startcam(event:StatusEvent):void {
  if (ExternalInterface.available) ExternalInterface.call(alert,
  event.toString());
  }
  }
  }
 
  On 19 September 2011 10:24, tom rhodes tom.rho...@gmail.com wrote:
 
  hey cedric if you've got code that you think 100% works on
 everything
  send
  it on and i'll put it up on the link. i thought that too :)
 
  after googling i've found stuff about looping through character
 names
  and
  attaching google cameras to video objects offstage, or pulling out
 the
  name
  for the usb cam on a mac if on mac OS, or even just using index 2
 for
  the
  mac. all seem a bit hacky to me. this is somethign that has worked
 in
  flash
  fine for a LONG time, that now appears to be broken. what's up?
 
 
  2011/9/19 Cédric Muller 

Re: [Flashcoders] webcam wackiness...

2011-09-18 Thread Dave Watts
 i want to confirm that this...

 http://46.4.226.29/camtest/

 does not work on a mac, and in chrome 14 beta on the pc?

It didn't work on my Mac (Lion, latest version of Chrome stable).

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] webcam wackiness...

2011-09-18 Thread Deepanjan Das
Dear Tom,
I recently developing an AR apps and my clients also face the same problem.
I asked them to update their flash player to 10.3.183.7


Check MAC flash player version by visiting the page -
http://www.adobe.com/software/flash/about/

That solved the problem.

The probable cause for the same may be due to latest OS upgrade and flash
player upgrade.


Warm Regards
Deepanjan Das
W: http://deepanjandas.wordpress.com
|| Om Manasamarthadata Shri Aniruddhaya Namah
||http://www.manasamarthyadata.com/
*Think of the environment before printing this email
__
*


On Mon, Sep 19, 2011 at 4:34 AM, tom rhodes tom.rho...@gmail.com wrote:

 hey all,

 i want to confirm that this...

 http://46.4.226.29/camtest/

 does not work on a mac, and in chrome 14 beta on the pc? massively simple
 webcam example, source below...

 code
 package
 {
 import flash.display.Sprite;
 import flash.events.Event;
  import flash.events.StatusEvent;
 import flash.media.Camera;
 import flash.media.Video;

 public class Main extends Sprite
 {
 private var cam:Camera;
  private var video:Video;
  public function Main():void
  {
 if (stage) init();
 else addEventListener(Event.ADDED_TO_STAGE, init);
  }
  private function init(e:Event = null):void
  {
 removeEventListener(Event.ADDED_TO_STAGE, init);
 // entry point
  cam = Camera.getCamera();
if (cam != null) {
 //cam.setMode(320, 240, 30, false);
  cam.setMode(400, 300, 30, false);
 video = new Video(cam.width, cam.height);
  video.attachCamera(cam);
 cam.addEventListener(StatusEvent.STATUS, startcam);
  addChild(video);
 }
 }
  private function startcam(event:StatusEvent):void {
 // stuff
  }
  }
  }
 /code

 i've NEVER experienced probs with webcam before, what is going on here?

 tom.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders