Skip to main content
Participant
August 10, 2016
Question

Flash 22.0.0.192--> getCameraList() is onning cam

  • August 10, 2016
  • 0 replies
  • 347 views

Flash 22.0.0.192

OS:Windows 7

Requirement:Our requirement is to only read all camera names of device.

Java script code:flash.media.Camera.Camera.names is oning camera only in specific hardware HP elitebook 8440  which contains windows 7 and Flash 22.0.0.192.

Please help..

Files:

1] Client.as

package com.ca.rm {   

    import flash.display.Sprite;

    import flash.media.Camera;

    public class Client extends Sprite {  

  public function getCameraList():Array{

  logger.debug("getCameraList()");

  //No error thrown

  return Camera.names;

  }    }}

2] Html file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script language="javascript">

function getHandle(id){

  if (window.document[id]){

  return window.document[id];

  }

  if (navigator.appName.indexOf("Microsoft")!=-1){

  return document.getElementById(id);

  }

  if (document.embeds && document.embeds[id]){

  return document.embeds[id];

  }

    return null;

  }

   

  function getCamName() {

  var obj = getHandle("riskminderclient");

  console.log("In function:getCamName.calling getCameraList()");

  alert(obj.getCameraList());

  console.log("Camera name:"+obj.getCameraList());

  console.log("Exitting getCamName()");

  }

</script>

</head>

<body onload="">

  <OBJECT WIDTH="0" HEIGHT="0" ALIGN=""

  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

  CODEBASE="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,5,0,0"

  id="riskminderclient">

  <PARAM NAME="allowScriptAccess" VALUE="always" />

  <PARAM NAME="quality" VALUE="high" />

  <PARAM NAME="bgcolor" VALUE="#ffffff" />

  <PARAM NAME="movie" VALUE="" />

  <PARAM NAME="flashvars"

  VALUE="readyCallback=flashReadyCallback&errorCallback=flashErrorCallback" />

  <EMBED WIDTH="0" HEIGHT="0" ALIGN=""

  TYPE="application/x-shockwave-flash"

  PLUGINSPAGE="//www.macromedia.com/go/getflashplayer"

  ALLOWSCRIPTACCESS="always" QUALITY="high" BGCOLOR="#ffffff"

  NAME="riskminderclient" SRC="riskminder-client.swf"

  FLASHVARS="readyCallback=flashReadyCallback&errorCallback=flashErrorCallback"></EMBED>

  </OBJECT>

  <input type="button" style="width: 150px" name="submit"

  value="Get Cam Name" onclick="getCamName()">

</body>

</html>

This topic has been closed for replies.