Skip to main content
Participant
November 14, 2010
Question

Accessing webcam from loaded swf

  • November 14, 2010
  • 1 reply
  • 825 views

Hello!

I am trying to load swf file with Loader class into AIR application. The broblem is that the loaded swf can not access web cam (it can when I run it standalone). Is there any security settings I have missed.

AIR loader code:

loader = new Loader();
loader.name = "moduleLoader";
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onModuleLoaded);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onModuleError);

var lc:LoaderContext = new LoaderContext(false);

loader.contentLoaderInfo.parentSandboxBridge = new StatsService(this);

lc.applicationDomain = ApplicationDomain.currentDomain;

loader.load(new URLRequest(FileSystem.resolvePath(configXML.appFile)), lc);

This topic has been closed for replies.

1 reply

Participant
November 15, 2010

Please, can you help me? I really don't see any way of getting webcam to work when loading an external swf.

Participant
November 17, 2010

I came down to the root of problem, the camera does not activate, when file is not in the same folder as AIR application.

When I load swf like this, the camera works:

_loader.load(new URLRequest('cameraTest.swf'), lc);

But it stops working, when the swf file resides in My Dowcuments folder:

_loader.load(new URLRequest('file:///C:/Users/elviss/Documents/data/cameraTest.swf'), lc);

Can you give me a clue on some security settings I need to tweak to load swf with camera from My Documents folder?

Participant
November 23, 2010

Ok, I guess nobody has ever faced this kind of problem, but can you atleast point me a direction to look for?