mercredi 23 avril 2014

ActionScript 3 - peut-on avoir aucun contrôle sur la vie privée de sécurité pop up en flash - Stack Overflow



Possible Duplicate:
How to get control on security privacy pop up in flash



Can we have any control over security privacy pop up in flash. I mean that I want to call function when user click on done button of privacy pop up.


We are using "Security.showSettings(SecurityPanel.PRIVACY);". This code is user for ask permission to user about their camera access.


Thank you..




This might be helpful. Have a look:


Detecting permissions for camera access


I have just tried it and works perfectly. This code can be used in place of you permission dialog.


var cam:Camera = Camera.getCamera(); 
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
var vid:Video = new Video();
vid.attachCamera(cam);
}
function statusHandler(event:StatusEvent):void{
if(event.code == Camera.Unmuted) // "Camera.Muted" or "Camera.Unmuted"
// good to go
else
// permission denied
}

This has an added advantage. If the user later on changes the camera permission from the setting box, then also the StatusEvent handler is fired


Update
I have tried and this also seems to work.


var cam:Camera = Camera.getCamera(); 
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
}
function statusHandler(event:StatusEvent):void{
if(event.code == "Camera.Unmuted") // "Camera.Muted" or "Camera.Unmuted"
trace("OK");// good to go
else
trace("NOK");// permission denied
}
Security.showSettings(SecurityPanel.PRIVACY);

But the StatusEvent Handler is fired as soon as the radio button in the popup is clicked not after the Done button is clicked.




Possible Duplicate:
How to get control on security privacy pop up in flash



Can we have any control over security privacy pop up in flash. I mean that I want to call function when user click on done button of privacy pop up.


We are using "Security.showSettings(SecurityPanel.PRIVACY);". This code is user for ask permission to user about their camera access.


Thank you..



This might be helpful. Have a look:


Detecting permissions for camera access


I have just tried it and works perfectly. This code can be used in place of you permission dialog.


var cam:Camera = Camera.getCamera(); 
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
var vid:Video = new Video();
vid.attachCamera(cam);
}
function statusHandler(event:StatusEvent):void{
if(event.code == Camera.Unmuted) // "Camera.Muted" or "Camera.Unmuted"
// good to go
else
// permission denied
}

This has an added advantage. If the user later on changes the camera permission from the setting box, then also the StatusEvent handler is fired


Update
I have tried and this also seems to work.


var cam:Camera = Camera.getCamera(); 
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
}
function statusHandler(event:StatusEvent):void{
if(event.code == "Camera.Unmuted") // "Camera.Muted" or "Camera.Unmuted"
trace("OK");// good to go
else
trace("NOK");// permission denied
}
Security.showSettings(SecurityPanel.PRIVACY);

But the StatusEvent Handler is fired as soon as the radio button in the popup is clicked not after the Done button is clicked.


0 commentaires:

Enregistrer un commentaire