View Full Version : [AS 2.0 Flash 8 pro]Flv Security problem
Cosmo1119
05-13-2007, 10:31 PM
Hi all,
I'm building an application that consists of a projector file (.exe) that is run locally and which loads various swf files form my remote server. I get the following error for each swf that is loaded from the server... (these swf either display an image or flv from the same server):
*** Security Sandbox Violation ***
Connection to null halted - not permitted from http://localhost/TVTOUR_CMS/main/client/widgets/video_test.swf
-- Remote SWFs may not access local files.
I tried adding a Domain Policy File on my server but it did not work..
Check the attached file for an example of the what I need to do.. you'll just have to change the server name and the flv file...
Please Help!!!
AdrienLyon
05-13-2007, 10:48 PM
I'm building an application that consists of a projector file (.exe) that is run locally and which loads various swf files form my remote server. In most cases this works just fine, except for the one that swf that plays flv files form the same server.
Can you explain a bit more? Can you show some code you use to load the FLV?
Cosmo1119
05-14-2007, 12:31 AM
Hi:
here is the code that goes on the first frame of the projector:
System.security.allowDomain("*");
this.ld._lockroot=true;
this.ld.loadMovie("http://localhost/TVTOUR_CMS/main/client/widgets/video_test.swf");
This is the code that goes into the first frame of video_test.swf:
var m_oConnection_nc:NetConnection;
var m_oStream_ns:NetStream;
this.m_oConnection_nc= new NetConnection();
//THIS SEEMS TO BE THE PROBLEM
this.m_oConnection_nc.connect(null);
this.m_oStream_ns = new NetStream(this.m_oConnection_nc);
this.m_oStream_ns.setBufferTime(3);
_root.Video_1.attachVideo(this.m_oStream_ns);
this.m_oStream_ns.play("http://localhost/TVTOUR_CMS/main/client/widgets/test.flv");
stop();
So to clarify the first movie is exported as a projector file (but could as well be a swf...) and it runs locally. It then loads a swf (video_test.swf) from the server. That swf should play a flv file that is on the same server bt that's when it doesn't work. I get the same result for a swf thatwould load an image from the server....
help!
AdrienLyon
05-14-2007, 01:27 AM
I guess this happens because your main swf (projector) is loading the external swf that loads the FLV. In the swf that loads the FLV you specify to connect to null and even though the swf was loaded from localhost it takes the domain of the hosting swf (your exe). It is trying to connect to a non-existing server, null.
I think you need to do something like:
this.m_oConnection_nc.connect("http://localhost");
Although I'm a 100% percent sure. Have a look at what the documentation says on this.
Cosmo1119
05-14-2007, 04:13 AM
Hi,
Ok so I tried that:
this.m_oConnection_nc.connect("http://localhost");
Now I don't get the warning which I guess is good, but the video does not play....
I tried looking for some documentation but it seems that my situation is not that common.
I really need to get this to work, do you have any ideas or could you try it for yourself with the files I posted?
Thank you for your help :) it is extremly appreciated!
his.m_oConnection_nc.connect("http://localhost"); should always connet(null) if you are not connecting to any flash media server.
In Flash publish setting pannel, there are 2 options for local playback security, "access local files only" and "access network files only". By default, it is local files, change it to network files then you won't see the alert when you try to load files over the internet. but then, this means you can't load from local disk anymore.
Cosmo1119
05-15-2007, 01:19 AM
Hi all,
I tried to make it work the way you suggested but it didn't work...
I'm relly running out of options here:( Is this even possible????
I've been stuck with this problem for over a month and I really need to finishthis..
Could someone provide a solution with the files I posted in my initial post? It's less than 20 lines of code and I would reaaaaaaally appreciate the help!
Thanks:)
AdrienLyon
05-15-2007, 02:49 AM
his.m_oConnection_nc.connect("http://localhost"); should always connet(null) if you are not connecting to any flash media server.
But the problem with connecting to null is that there is not a server in the null domain. The swf that loads the FLV is loaded by an exe/swf so the loaded swf should inherit the security policies of the exe/swf and null means nothing in that domain. Thats the initial error you posted.
Unfortunately, I don't have a solution for you right now.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.