Security sandbox violation when URL doesn't have 'www'

I am loading an external swf file from the same domain into my main flash movie using an absolute path: "http://www.sitename.com/movie.swf". The problem is that when someone goes to the site without the 'www' in the address: "http://sitename.com" - the movie throws a sandbox error upon trying to load the 2nd movie.
I have a crossdomain in place set to: <allow-access-from domain="*" secure="false"/>.
I also have: Security.allowDomain("*"); in the document class of the main movie.
I realize I could use a relative path to load the movie instead of the absolute path, but shouldn't the cross domain file and/or the allowDomain command take care of the security issues? Is there another workaround besides the relative path?
Thanks,
Amanda

The crossdomain should work.  Check to make sure you have it set up properly.
Another workaround is to use the LocalConnection class to grab the current domain.  We do this at my company, where we distribute files out to the local server of the branch.
import flash.net.LocalConnection;
var lc:LocalConnection = new LocalConnection();
var myIP:String = lc.domain();
var pathToLoad = "http://"+myIP+"/movie.swf";

Similar Messages

  • Security Sandbox Violation when trying to open new window

    Hi guys
    I have a flash button that I would like to open a new window
    of a specific size when clicked. I found some code on a thread at
    flashkit and tried that out, but when testing in flash I get the
    following message:
    *** Security Sandbox Violation ***
    Connection to javascriptopenNewWindow('
    http://www.designlogic.com.ph/assets/Web_pages/tropicanacomp.gif','height=500,width=500,to p=10,left=100,toolba
    r=no,scrollbars=yes') halted - not permitted from
    file:///C|/Users/James/Graphics/Websites/Design%20Logic/Raw%5FImages/Flash/flashbuttons/G allery%20icons/webPagesIcons/Tropicana1.swf
    Here is the code I inserted into the actionscript:
    on (release) {
    getURL("javascriptopenNewWindow('
    http://www.designlogic.com.ph/assets/Web_pages/tropicanacomp.gif','height=500,width=500,to p=10,left=100,toolba
    r=no,scrollbars=yes') ");
    I also tried steamrolling ahead and testing it from
    dreamweaver after inserting the flash onto my page, but it doesn't
    fucntion. No surprises there.
    Would really appreciate it if someone could help me out with
    this.

    Oh its AS 2.0 by the way :)

  • Security Sandbox Violation when calling a remote service from a worker

    From my application, I make calls to a BlazeDS server, that works fine.
    I added a worker that calls the same services on the same server. But then, only for the calls from the worker, I have a Security Sandbox Violation error. I launch the application from FB in debug mode.
    This is the message :
    Error: [strict] Ignoring policy file at http://xxxxxxxxxxxx/crossdomain.xml due to incorrect syntax.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
    *** Security Sandbox Violation ***
    Connection to http://xxxxxxxxxxxxxx/appstore-admin/messagebroker/amfpolling halted - not permitted from file:///D:/Projects/appstoreClientsNext/MultiAppstoreAdmin/bin-debug/MultiAppstoreAdmin.swf
    Error: Request for resource at http://xxxxxxxxxxxxx/appstore-admin/messagebroker/amfpolling by requestor from file:///D:/Projects/appstoreClientsNext/MultiAppstoreAdmin/bin-debug/MultiAppstoreAdmin.swf is denied due to lack of policy file permissions.
    What should I do to allow the worker to make remote calls ?

    I made some progress on this. There are two different cases :
    1) The service you want to access has a crossdomain.xml file
    All the workers can access the service without a problem.
    2) The service you want to access doesn't have a crossdomain.xml file
    Whether you launch from FB in debug mode or you put your application on the same server you are trying to access, only the primordial worker will access the service, the other workers will encounter a security error.
    I believe this is a bug. Shouldn't a worker have the same access privileges as the primordial worker ?

  • *** Security Sandbox Violation *** when calling a You Tube video

    Hi,
    I get an error when I run my SWF, it says
    *** Security Sandbox Violation ***
    SecurityDomain 'http://s.ytimg.com/yt/swfbin/apiplayer3-vflS6GT64.swf' tried to access incompatible context 'file:///C|/Users/mww/web/crafty%20copy/10%2D11.swf'
    My code is
    // start of code
    Security.allowDomain("www.youtube.com");
    var my_playerbject;
    var my_loader:Loader = new Loader();
    my_loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
    my_loader.contentLoaderInfo.addEventListener(Event .INIT, onLoaderInit);
    function onLoaderInit(e:Event):void{
    movArticles.movArticle2.videoPlayerHolder.videoMov 2.addChild(my_loader);
    my_player = my_loader.content;
    my_player.addEventListener("onReady", onPlayerReady);
    function onPlayerReady(e:Event):void{
    my_player.setSize(640,360);
    my_player.cueVideoById("CtOj8kpLIlI",0);
    // end of code
    Any help would be much apreciated, Thanks

    I tried adding those, as well as these :
    Security.allowDomain("www.youtube.com");
    Security.allowDomain("s.ytimg.com");
    Security.allowDomain("s2.ytimg.com");
    Security.allowDomain("*.youtube.com");
    Security.allowDomain("*.ytimg.com");
    Security.allowDomain("com.google.utils.SafeLoader");
    Security.allowDomain("http://s.ytimg.com");
    Security.allowDomain("http://www.youtube.com/apiplayer?version=3");
    Security.allowDomain("o-o.preferred.lhr14s07.v15.lscache6.c.youtube.com");
    Security.allowDomain("i1.ytimg.com");
    Security.allowDomain("i2.ytimg.com");
    Security.allowDomain("i3.ytimg.com");
    Security.allowDomain("i4.ytimg.com");
    Security.allowDomain("http://www.youtube.com");
    Security.allowDomain("googleads.g.doubleclick.net");
    Security.allowDomain("gdata.youtube.com");
    Security.allowDomain("http://s0.2mdn.net");
    Security.allowDomain("http://pagead2.googlesyndication.com");
    Security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
    Security.loadPolicyFile("http://s2.youtube.com/crossdomain.xml");
    Security.loadPolicyFile("www.youtube.com");
    Security.loadPolicyFile("http://www.youtube.com");
    Security.loadPolicyFile("s.ytimg.com");
    Security.loadPolicyFile("http://s.ytimg.com");
    Security.loadPolicyFile("s2.ytimg.com");
    Security.loadPolicyFile("i1.ytimg.com");
    Security.loadPolicyFile("i2.ytimg.com");
    Security.loadPolicyFile("i3.ytimg.com");
    Security.loadPolicyFile("googleads.g.doubleclick.net");
    Security.loadPolicyFile("gdata.youtube.com");
    Security.allowInsecureDomain("www.youtube.com");
    Security.allowInsecureDomain("http://www.youtube.com");
    Security.allowInsecureDomain("*.youtube.com");
    Security.allowInsecureDomain("s.ytimg.com");
    Security.allowInsecureDomain("http://s.ytimg.com");
    Security.allowInsecureDomain("s2.ytimg.com");
    Security.allowInsecureDomain("*.ytimg.com");
    Security.allowInsecureDomain("i1.ytimg.com");
    Security.allowInsecureDomain("i2.ytimg.com");
    Security.allowInsecureDomain("i3.ytimg.com");
    Security.allowInsecureDomain("googleads.g.doubleclick.net");
    Security.allowInsecureDomain("gdata.youtube.com")
    YouTube's own ActionScript player example gives the same warnings. I think it might be something to do with the way the API is loaded, because instead of using a Loader & URLRequest I use:
    <s:SWFLoader id="swfload" source="http://www.youtube.com/apiplayer?version=3"/>
    Then in ActionScript:
    protected var player:Object;
    player=swfload.content;
    Then access the API like this:
    player.setPlaybackQuality(q);
    Every attempt I made to use a Loader resulted in an error when accessing the API: "Access of undefined property setPlaybackQuality", but when loaded into an Object like YouTube's own example, Flex does not check for these functions before compiling and accesses them after they have loaded. I tried finding out about bridges among other things, but even the YouTube forums cannot answer this one and it is a common problem.
                Security.allowDomain("www.youtube.com");
                Security.allowDomain("s.ytimg.com");
                Security.allowDomain("s2.ytimg.com");
                Security.allowDomain("*.youtube.com");
                Security.allowDomain("*.ytimg.com");
                Security.allowDomain("com.google.utils.SafeLoader");
                Security.allowDomain("http://s.ytimg.com");
                Security.allowDomain("http://www.youtube.com/apiplayer?version=3");
                Security.allowDomain("o-o.preferred.lhr14s07.v15.lscache6.c.youtube.com");
                Security.allowDomain("i1.ytimg.com");
                Security.allowDomain("i2.ytimg.com");
                Security.allowDomain("i3.ytimg.com");
                Security.allowDomain("i4.ytimg.com");
                Security.allowDomain("http://www.youtube.com");
                Security.allowDomain("googleads.g.doubleclick.net");
                Security.allowDomain("gdata.youtube.com");
                Security.allowDomain("http://s0.2mdn.net");
                Security.allowDomain("http://pagead2.googlesyndication.com");
                Security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
                Security.loadPolicyFile("http://s2.youtube.com/crossdomain.xml");
                Security.loadPolicyFile("www.youtube.com");
                Security.loadPolicyFile("http://www.youtube.com");
                Security.loadPolicyFile("s.ytimg.com");
                Security.loadPolicyFile("http://s.ytimg.com");
                Security.loadPolicyFile("s2.ytimg.com");
                Security.loadPolicyFile("i1.ytimg.com");
                Security.loadPolicyFile("i2.ytimg.com");
                Security.loadPolicyFile("i3.ytimg.com");
                Security.loadPolicyFile("googleads.g.doubleclick.net");
                Security.loadPolicyFile("gdata.youtube.com");
                Security.allowInsecureDomain("www.youtube.com");
                Security.allowInsecureDomain("http://www.youtube.com");
                Security.allowInsecureDomain("*.youtube.com");
                Security.allowInsecureDomain("s.ytimg.com");
                Security.allowInsecureDomain("http://s.ytimg.com");
                Security.allowInsecureDomain("s2.ytimg.com");
                Security.allowInsecureDomain("*.ytimg.com");
                Security.allowInsecureDomain("i1.ytimg.com");
                Security.allowInsecureDomain("i2.ytimg.com");
                Security.allowInsecureDomain("i3.ytimg.com");
                Security.allowInsecureDomain("googleads.g.doubleclick.net");
                Security.allowInsecureDomain("gdata.youtube.com")

  • Flash CS5.5: Loading XML-file causes a "Security Sandbox Violation"

    Hi,
    after upgrading from CS3 to CS5.5, i get a "Security Sandbox Violation" when loading a XML-file. With CS3 everything was fine, but now my file is not working any more. The XML-file and my SWF-file are stored in the same directory and it nether work local nor on the webserver.
    I don't know the correct message in english, but flash tells me something like:
    "Security Sandbox Violation"
    access to file:[]data.xml disconnent - not allowed from file:[]myfile.swf
    Why am I not allowed to load an XML-file from the same directory/domain any more? And how can I get my data into my flash-File now?
    It doesn't seems to be a Flash-Player-Problem, because an older version with the same code still works. So the problem has to be located in Flash CS5.5
    Can anybody help me? Thanks a lot!
    Sonja

    Please ask such questions on the product specific forums. It is highly doubtful that anyone wil lsee it here.
    Mylenium

  • Youtube: security sandbox violation

    Does anybody have a recipe for loading the AS3 chromeless player into a Flex application such that you don't get the 'incompatible context' errors constantly?
    *** Security Sandbox Violation ***
    SecurityDomain 'http://core-dev.thismoment.com/client/Demo.html' tried to access incompatible context 'http://www.youtube.com/apiplayer?version=3'
    I've been experimenting all day with  Security.allowDomain, Security.allowInsecureDomain, and  LoaderContext, but I haven't found the magic combination yet. The  main thing I want to do is be able to track the mouse wherever it goes on the screen.  Right now, if I mouse over the YouTube player, mouse events stop getting sent to the application, and I get that sandbox violation error in the debug log.  It works fine if I run the swf from a file: URL - it just doesn't work when it's coming over http, so obviously there is some sort of Flash security model thing kicking in.

    Doors only get opened from the inside otherwise all the bad guys would come
    in.
    Only the loaded SWF can allow access from the loading SWF.

  • How to resolve security sandbox violation (Error#2148) in Flex 3 on XP?

    Hi,
    When I tried to access an image on c:\ (on XP), I get the following error:
    *** Security Sandbox Violation ***
    Connection to file:///C:\DBFiles\3.jpg halted - not permitted from http://localhost/test-debug/test.swf
    -- Remote SWFs may not access local files.SecurityError: Error #2148: SWF file http://localhost/ullmanphp-debug/ullmanphp.swf cannot access local resource file:///C:\DBFiles\INDSprintOrgChart.pptx\3.jpg. Only local-with-filesystem and trusted local SWF files may access local resources.
    at flash.display::Loader/_load()
    at flash.display::Loader/load()
    It looks like some sort of mismatch on security settings. I have done the following so far (based on what I got by googling....)
    1. Flex comipler setting additional compiler arguments:  -use-network=false
    2. I have added a crossdomain.xml on the source directory with these lines...
    <site-control permitted-cross-domain-policies="master-only"/>
    <allow-access-from domain="*"/>
    <allow-http-request-headers-from domain="*" headers="SOAPAction"/>
    However, error is still appearing. How do I fix this for testing on my local machine. I cannot move to a webserver at this time.
    Thanks!.

    How do I set Security.sandboxType related to flash player? When I try to see it in my application through debugger it says "remote". I think I need to set it to one of the following from the adobe manual pages...
    Security.sandboxType has one of the following values:
    remote (Security.REMOTE)—This file is from an Internet URL and operates under domain-based sandbox rules.
    localWithFile (Security.LOCAL_WITH_FILE)—This file is a local file, has not been trusted by the user, and it is not a SWF file that was published with a networking designation. The file may read from local data sources but may not communicate with the Internet.
    localWithNetwork (Security.LOCAL_WITH_NETWORK)—This SWF file is a local file, has not been trusted by the user, and was published with a networking designation. The SWF file can communicate with the Internet but cannot read from local data sources.
    localTrusted (Security.LOCAL_TRUSTED)—This file is a local file and has been trusted by the user, using either the Flash Player Settings Manager or a FlashPlayerTrust configuration file. The file can read from local data sources and communicate with the Internet.
    application (Security.APPLICATION)—This file is running in an AIR application, and it was installed with the package (AIR file) for that application. By default, files in the AIR application sandbox can cross-script any file from any domain (although files outside the AIR application sandbox may not be permitted to cross-script the AIR file). By default, files in the AIR application sandbox can load content and data from any domain.
    Any input on how to set it would be greatly appreciated. Thanks!

  • Security Sandbox violation, opening links in Flash player

    Hi,
    I have a swf content and its content served from a content management server say for eg, http://www9.abc.com into the html file which is served from http://qwww9.abc.com The links embedded in the flash were not working, when these links are clicked I get this error when tried with Flash debugger player.
    *** Security Sandbox Violation ***SecurityDomain 'http://qwww9.abc.com/' tried to access incompatible context 'https://www9.abc.com/sample.swf'
    I had set a crossdomain policy file in a custom location in the content management server for this issue, but with the Flash player 9,0,115,0 this stopped working due to default policy change to "master-only". I will not be able to have this policy file in the root folder of the content management server or have the policy set in the HTTP response header.
    Is there anyother solution for this issue, for having the links work without setting the crossdomain policy file?
    Thanks in advance...

    How do I set Security.sandboxType related to flash player? When I try to see it in my application through debugger it says "remote". I think I need to set it to one of the following from the adobe manual pages...
    Security.sandboxType has one of the following values:
    remote (Security.REMOTE)—This file is from an Internet URL and operates under domain-based sandbox rules.
    localWithFile (Security.LOCAL_WITH_FILE)—This file is a local file, has not been trusted by the user, and it is not a SWF file that was published with a networking designation. The file may read from local data sources but may not communicate with the Internet.
    localWithNetwork (Security.LOCAL_WITH_NETWORK)—This SWF file is a local file, has not been trusted by the user, and was published with a networking designation. The SWF file can communicate with the Internet but cannot read from local data sources.
    localTrusted (Security.LOCAL_TRUSTED)—This file is a local file and has been trusted by the user, using either the Flash Player Settings Manager or a FlashPlayerTrust configuration file. The file can read from local data sources and communicate with the Internet.
    application (Security.APPLICATION)—This file is running in an AIR application, and it was installed with the package (AIR file) for that application. By default, files in the AIR application sandbox can cross-script any file from any domain (although files outside the AIR application sandbox may not be permitted to cross-script the AIR file). By default, files in the AIR application sandbox can load content and data from any domain.
    Any input on how to set it would be greatly appreciated. Thanks!

  • Error #2048: Security sandbox violation

    I've been developing Flex apps for a couple of years now and feel comfortable with my development environment.
    I'm testing out Gumbo in my same environment (new workspace): WAMP based
    My test app works fine on my localhost set up... but when I upload the files to my hosted domain server... I get Error #2048: Security sandbox violation.
    Specifically:
    - I'm invoking an HTTPService by setting the url to a relative path (folder/file in same dir as the swf)
    - I set method to POST and useProxy to false
    (<fx:Declarations>
            <s:HTTPService id="contentService" url="data/verd_content.xml" method="POST" useProxy="false" resultFormat="e4x" />
        </fx:Declarations>)
    - I wrapped the send call in a try / catch block and show an Alert with the error message in the catch... here's what it says
    body = (null)
      clientId = "DirectHTTPChannel0"
      correlationId = "F4B9A542-8B00-5CDB-3C36-1316919FC255"
      destination = ""
      extendedData = (null)
      faultCode = "Channel.Security.Error"
      faultDetail = "Destination: DefaultHTTP"
      faultString = "Security error accessing url"
      headers = (Object)#1
        DSStatusCode = 0
      messageId = "E629F555-EF8B-E535-7CE4-13169662A82A"
      rootCause = (flash.events::SecurityErrorEvent)#2
        bubbles = false
        cancelable = false
        currentTarget = (flash.net::URLLoader)#3
          bytesLoaded = 0
          bytesTotal = 0
          data = (null)
          dataFormat = "text"
        eventPhase = 2
        target = (flash.net::URLLoader)#3
        text = "Error #2048: Security sandbox violation: http://****.com/Main.swf cannot load data from http://localhost:***/data/verd_content.xml?hostport=***t.com&https=N&id=F4B9A542-8B00-5CDB -3C36-1316919FC255."
        type = "securityError"
      timestamp = 0
      timeToLive = 0
    *NOTE: I obfuscated parts of the url for security reasons
    I read the other similar posts here about problems like this when using the PHP / Zend set up... but I checked the .actionScriptProperties file and it does not have any URLs in there (like localhost:port#)
    I'm not using a service-config.xml file in this project... but I have set up WebORB for PHP servers and use that all the time... so I know how that works...
    Is this a bug or am I missing something new in the Gumbo ?
    Again: my swf file is in a folder in the webroot on my ISP
    also inside that folder is another folder with an XML file in it
    I'm setting an HTTPService call using the url parameter on a POST with a relative file path (folder/filename.xml)
    changing the url to an absolute makes no difference...
    thanks in advance for any help

    Sure...
    here's the code that contains both the HTTPService setup and the URLLoader setup... like i said in the original post.. the HTTPService call throws the error described, whereas the URLLoader call does not:
    private var loader : URLLoader = new URLLoader();
    private var req : URLRequest = new URLRequest("data/***dant_content.xml");//path obfuscated
    protected function Application_creationComplete():void
        // This works...
        loader.addEventListener( Event.COMPLETE, parseContent );
        loader.addEventListener( IOErrorEvent.IO_ERROR, contentFault );
        // This does not...
        /* contentService.addEventListener( ResultEvent.RESULT, parseContent );
            contentService.addEventListener(FaultEvent.FAULT, contentFault ); */
        try
            loader.load( req );
        catch (err:Error)
            Alert.show("In Try Catch Error Block: " + err.message);
            currentState='home';
    the HTTPService was set up like this: (again, i obfuscate the URLs for security)
        <fx:Declarations>
            <s:HTTPService id="contentService" url="data/***dant_content.xml" method="POST" useProxy="false" resultFormat="e4x" />
        </fx:Declarations>
    the parseContent function setup in the event listener justs reads the XML file and uses that data to build an image gallery.
    hope this helps (for what its worth: I'm not doing anything serious with Gumbo as of yet due to these kinds of bugs)

  • Security sandbox violation: BitmapData.draw

    Hello,
    I got this error:
    SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: A policy file is required, but the checkPolicyFile flag was not set when this media was loaded. 
    when I try to draw a frame of a movie that is downloading from another server. Crossdomain.xml is set. Another Jpgs are correctly drawn but only a movie causes an error.
    I need to checkPolicyFile but where should I do this? I have no direct access  to Loader to set up LoaderContext(true) ...
    Thanks,
    Michal

    I too would love to know how we can pass in our own LoaderContext to set the security domain. I'm receiving the same error after snapshotting a loaded SWFElement bug/watermark.
    e.g.
    var bug:MediaElement = new SWFElement(new URLResource(url));
    var bugTrait:LoadTrait = bug.getTrait(MediaTraitType.LOAD) as LoadTrait;
    bugTrait.load();

  • Security sandbox violation: BitmapData.draw on CloudFront/S3.

    I'm using Cloudfront/AS3 to stream some video in RTMP.
    When I try to do a Bitmap.draw, I get this error:
    [Fault] exception, information=SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: [my_url] cannot access unknown URL. No policy files granted access.
    Since there is no Application.xml, I can't change the <VideoSampleAccess />.
    My crossdomain.xml is available.
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="master-only"/> 
    <allow-access-from domain="*"/>
    <allow-http-request-headers-from domain="*" headers="SOAPAction"/>
             </cross-domain-policy>
    My bucket policy is:
      "Version": "2008-10-17",
      "Statement": [
          "Sid": "AddPerm",
          "Effect": "Allow",
          "Principal": {
            "AWS": "*"
          "Action": "s3:GetObject",
          "Resource": "arn:aws:s3:::[my url]/*",
          "Condition": {}
    And this is my CORS configuration:
    <CORSConfiguration>
        <CORSRule>
            <AllowedOrigin>*</AllowedOrigin>
            <AllowedMethod>GET</AllowedMethod>
            <MaxAgeSeconds>3000</MaxAgeSeconds>
            <AllowedHeader>Authorization</AllowedHeader>
        </CORSRule>
    </CORSConfiguration>
    Not sure what I must change to give myself access.
    Thanks
    Martin

    If you don't have access to the server - you will not be able to accomplish BitmapData.draw() on the video or any of its parents. The policy error refers to streaming server side policy. If you look into RTMP traffic - you will see at what point security request goes.
    I don't know what range of services Amazon cloud offers but I could imagine that, since they do offer pretty granular access to application instances, at some level it is possible to gain access to the server or engage their support to help you. I may be wrong though.

  • This bug has been around for over a year: SecurityError: Error #2123: Security sandbox violation

    Hi,
    The bug of 'SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///xxx/xxx.swf cannot access rtmfp://fms4.acrobat.com/cocomo/na2-sdk-xxx/xxx. No policy files granted access.' was first reported in lccs forum over a year ago:
    http://forums.adobe.com/message/2803074
    But the bug is still around. The bug can be generated by calling BitmapData.draw() on a flash.media.Video object which is attached to a p2p stream. It looks like the solution is to have the publisher to call:
    send("|RtmpSampleAccess", true, true)
    on the NetStream object _before_ the subscriber calls NetStream.play(), in order to give the permission to subscribers for audio and video streams.
    In lccs library, the above permission authorisation happens in WebcamPublisher:
    protected function onNetStatus(p_evt:NetStatusEvent):void
    if (p_evt.info.code=="NetStream.Connect.Success") {
    setTimeout(sendSnapShotPermission, 500);
    _stream.send("|RtmpSampleAccess", true, true);
    protected function sendSnapShotPermission():void
    _stream.send("|RtmpSampleAccess", true, true);
    but it doesn't help the problem. In fact, it is not clear to me when this 'snap shot permission' is sent to the subscriber.
    One more note: This is not a critisism for the lccs development quality, but rather a question on how ready lccs is for production use. After encountering this bug, I had to go through the lccs code (the open source parts), and found out that the library is not really written, well, carefully, and it is full of temporary quick-n-dirty fixes.
    For instance in the above example, sendSnapShotPermission() is called after 500 milliseconds, probably to allow something to happen before calling the method, but how can you be sure that it will happen in 500 milliseconds? Probably,an event listener should have been used. Immediately in the next line, we see:
    _stream.send("|RtmpSampleAccess", true, true);
    which is a duplicate of sendSnapShotPermission(). many examples like this can be found throughout the library.
    Aureliano

    Hi Nigel,
    Two questions:
    1. When the publisher sends the access permission to the subcriber by:
    netStream.send("|RtmpSampleAccess", true, true)
    , on the subscriber side, what event or function can handle the guaranteed receipt of the access permission? Currently it is possible to draw the incoming stream video upon receiving NetStream.Play.Star and waiting for 5 seconds or so:
    public class MyWebcamSubscriber extends WebcamSubscriber {
    override protected function layoutCameraStreams():void
    // trying the event listener seems to work here.
    _streamManager.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    override protected function onNetStatus(e:NetStatusEvent):void
    super.onNetStatus(e);
    case "NetStream.Play.Start":
    setTimeout(function():void {
    // draw the video from the incoming stream here.
    }, 5000);
    The questions is, which event can let the subscriber know that it has the access permission to the video stream?
    2. In WebcamPublisher, why is that the access permission is sent 3 times?
    a. Once on receiving NetStream.Connect.Success with 0.5 second delay, as in below.
    b. Once immediately upon receiving NetStream.Connect.Success, as in below.
    protected function onNetStatus(p_evt:NetStatusEvent):void
    if (p_evt.info.code=="NetStream.Connect.Success") {
    setTimeout(sendSnapShotPermission, 500);
    _stream.send("|RtmpSampleAccess", true, true);
    protected function sendSnapShotPermission():void
    _stream.send("|RtmpSampleAccess", true, true);
    c. Once in onConnectionTypeChange() with 2 seconds delay:
    protected function onConnectionTypeChange(p_evt:StreamEvent):void
    if ( _streamManager.isP2P) {
    _stream= new NetStream(_connectSession.sessionInternals.session_internal::connection as NetConnection,NetStream.DIRECT_CONNECTIONS);
    setTimeout(sendSnapShotPermission, 2000);

  • HTTPService Security Sandbox Violation

    Hello there.
    Using the HTTPService component to the URL that is seen
    below,
    I get the following message:
    [SWF]
    D:\AdobeFlexTraining\_workspace\AdobeODT\bin-debug\AdobeODT.swf -
    1,042,346 bytes after decompression
    *** Security Sandbox Violation ***
    Connection to
    212.199.178.211:4000/WebLogger/Logger?op=get%5Froute&UNIT%5FID=demo
    halted - not permitted from
    file://D:\AdobeFlexTraining\_workspace\AdobeODT\bin-debug\AdobeODT.swf
    I have a trial version of Flex Builder 3.
    How can I run this request, nevertheless.
    Thanks

    Probably FB, being an IDE, allows you to act as if you were
    on the network, so -use-network=true may be ignored (unless you
    execute the SWF outside of FB).
    The command line probably respects -use-network=true so for
    testing set to false, and when putting the SWF on the network set
    to true.

  • Flex 4 + AIR 2 + mx:Image = Security Sandbox Violation!

    Hi there!
    I've been using Flex 4 and AIR 2 for some time now and there's a bug (or is it really one) that I always get and can't understand...
    Whenever I use a <mx:Image> to load an image (JPG) on a remote server that has a valid crossdomain.xml I get some annoying warnings. Of course, these only are warnings and everything runs fine (except that) but it's a pain to debug an app that has lots of logs like that:
    *** Security Sandbox Violation ***
    SecurityDomain 'http://static-p3.fotolia.com/jpg/00/07/56/92/110_F_7569245_9hdeWKxUxFRNYuowdSDBNv0YFN9xTJ9 S.jpg' tried to access incompatible context 'app:/Main.swf'
    I've googled it and found lots of others folks/threads about this, but none of them provide a valid solution... Seems like it's specific to AIR because some answers/solutions I found work in a basic SWF, but fail in an AIR app.
    Is that a bug in Flex?
    Am I wrong about the crossdomain.xml?
    How could a JPG raise a Security Sandbox Violation?
    Tips or tricks, anyone?

    AIR has different security rules because it doesn't really have a "domain"
    to compare against crossdomain.xml.  The warnings are annoying and
    misleading and usually indicate that some code is trying to access the
    bitmap inside a try/catch block.  Usually you can ignore any warning that
    doesn't stop execution.

  • Error 2142 - security sandbox violation

    Hi,
    I have a problem when I try to compile my player, I get the following error:
    SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property. file:///C|/development/Flash/Pathe%20ads/New%20cmpt%20sample%20code/AS3ComponentDemoCode% 5Fv2.1/DemoPlayer3Component.swf was attempting to load http://objects.tremormedia.com/embed/swf/acudeo.swf?rand=949275459.
    What's odd is that:
    1. I have used Security.allowDomain("http://objects.tremormedia.com/"); in the source code
    2. This was working fine the day before last!
    I have tried adding a crossdomain.xml file in the folder where I build the player, still no joy.
    Can anyone help me with this? I tried throughout yesterday to fix it to no avail. I've even tried installing and building the player on a different machine to double check there wasn't something wrong on my PC.
    Any help would be great - I'm tearing my hair out!

    Hi,
    If you're still having issues, feel free to reach out to us directly. [email protected] or me personally at [email protected]
    Thanks,
    Andrew Baisley
    Sr Solutions Engineer
    Tremor Media

Maybe you are looking for