0
votes

I am using Flash Professional authoring tool with ActionScript 3 code. Basically, I'm trying to capture a live webcam feed using NetConnection, NetStream Camera and Video classes via Flash Media Development Server. When I run the code I receive this in my output:

ArgumentError: Error #2126: NetConnection object must be connected. at flash.net::NetStream/ctor() at flash.net::NetStream()

I don't really understand what could be causing this error my code is perfectly fine..Its very frustrating. When I debug I get this:

SecurityError: Error #2028: Local-with-filesystem SWF file file:///C|/Users/Name/AppData/Local/Temp/Untitled%2D1.swf cannot access Internet URL rtmfp://localhost/flashExam. [SWF] C:\Users\Name\AppData\Local\Temp\Untitled-1.swf - 3853 bytes after decompression

It appears the swf file cannot gain access FMS. Why is this? And, does anyone know what I can do to resolve these issues?

2

2 Answers

0
votes

Are you running the SWF locally, e.g., opening in the browser or from a local HTML opened in the browser? Flash doesn't let you normally connect to servers and services outside of the domain. Try running a local server (e.g. XAMPP/Apache) or hosting it somewhere and trying again.

0
votes

You could also try changing your flash settings to allow your swf location to be trusted. Generally the flash player doesn't allow a swf running from the file system to access resources on the internet. Try heading over to the settings panel and add the folder you are running your swf from.