Cedric, I ran into this issue several months back and after discussions with Macromedia development it turns out this is a bug in the flash player. The first thing to understand is that when one SWF is loaded into another, all the 'relative URL's" in the remote swf (in your case B.swf) will be evaluated relative to the base URL of the loading swf (in your case A.swf). In the case where the loading swf is a local swf, this behavior doesn't work so well.
So the bug as I understand it is that the "null" being passed into NetConnection.connect is being treated as a relative URL by A.swf, and is internally being appended to the "base URL" of A.swf (which is a local filesystem path). When the connection is attempted, A.swf thinks B.swf is trying to open a connection to some local path, which is restricted by flash's security, hence the security violation message. I was told that the bug is fixed in Flash Player 9, so you may want to try that and see if that fixes your issue. Also, if you can run A.swf remotely (i.e., serve it from the mydomain.com server) instead of locally, that would get around this issue as well. -- Vishal On 8/2/06, Cedric Muller <[EMAIL PROTECTED]> wrote:
A.swf: (local, on HD) loads in B.swf (remote, on www.mydomain.com/dir/B.swf) using a MovieClipLoader B.swf starts a NetConnection to stream a FLV (from same domain, www.mydomain.com/dir/files/movies/any.flv) This works nicely if I compile B.swf and test (I see the FLV being played) now, if I upload B.swf on 'www.mydomain.com/dir/B.swf' and launch A.swf from the local drive, this just fails with the following DUMB message: *** Security Violation *** Connection interrupted with null - forbidden operation from www.mydomain.com/dir/B.swf -- distant SWF files don't have access to local files. I am in a localTrusted sandbox, and using MovieClipLoader + allowDomain always went fine for me..... here is all the code in B.swf: var netConn = new NetConnection(); netConn.connect(null); var netStream = new NetStream(netConn); var link = "http://www.mydomain.com/dir/files/movies/any.flv"; netStream.onStatus = function(info) { } this.video_player.attachVideo(netStream); this.video_player.smoothing = true; netStream.setBufferTime(5); netStream.play(link); (nb: this is the basic code for loading FLVs by creating a local stream) How can I deal with 'null' ? null is required for streaming FLV files without connecting to a FMS (ex FCS) server (see live docs) netConn.connect(null) but then it fails the whole thing of course, I did System.security.allowDomain("*"); What SHOULD I consider now ? I am suspecting the connect method to pass the argument whatever it is ... by passing 'null' Flash still tries to establish a connection, hence my problem. I was thinking someone did hack the NetConnection class (but I couldn't find any hacked NetConnection), what else ? thanks in advance, Cedric _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com