BitmapData.draw() and Security

I am dynamically creating screen captures from flv files
located in separate sub domains through the Bitmap Data Draw
method. The problem is the illusion that flash calls security.
"When you call the BitmapData.draw() method with progressive
video as the source parameter, the caller of BitmapData.draw() must
either be from the same sandbox as the FLV file, or the server of
the FLV file must have a policy file that grants permission to the
domain of the calling SWF file. You can request that the policy
file be downloaded by setting the checkPolicyFile property of the
NetStream object to true."
Here is my first question. This seems to only apply to
"progressive video". Is this yet another attempt to make us buy
stream servers?
And now my second question.
Why is it that an end user can tap the flv files and draw
freely as long as the embed object code references a cached version
of the swf file but the remote swf file hosted on a separate sub
domain in the same network needs to download a copy of the "policy
file"?

Could you try this - Open and swf, rightClick - Goto
settings, then click Advanced. On the webPage click on "Global
Security settings panel".
If you don't find your local directory in there, add it and
see if things work?
If not, it would be good if you could post the chunk of code
which is creating problems.

Similar Messages

  • BitmapData.draw() SecurityError: Security sandbox violation

    i am loading and playing a local video file with appendBytes() and when i call a bitmapData.draw() function
    below exception comes up.
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw
    cannot access null. No policy files granted access.
    what should i do???....

    Sir i already mention in my last message i test it with both relative and absolute.
    Yes i khow relative paths works fine when i do some thing like this
    <mx:VideoDisplay x="0" y="0" width="516" height="379" source="../user_data/uploads/cd73502828457d15655bbd7a63fb0bc8/v/1345023450-Action_.flv"/>
    bitmap.draw works fine in above case but my scenario is different i am loading a complete video as bytearray before playing and play video from that bytes
    private function fileLoaderComplete(event:Event):void
         //Pass the loaded bytes to player
           player.AddVideo(urlLoader.data);
    //This is Add video Function in Player.mxml
    public function AddVideo(VideobyteArray:ByteArray):void
                    if(ns == null)
                        var nc:NetConnection = new NetConnection();
                        nc.connect(null);
                        ns = new NetStream(nc);
                       // ns.checkPolicyFile = true;
                        ns.soundTransform = new SoundTransform(0.0);
                        ns.client = this;
                        ns.addEventListener(NetStatusEvent.NET_STATUS, nsStatus);
                    videoData = VideobyteArray;
                    GetTags(videoData);
                    ns.play(null);
                    ns.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
                    ns.appendBytes(VideobyteArray);
                    video.attachNetStream(ns);
                    playBar.TogglePlay(true);
    i think its a bug in flash sdk 4.6 (Flash Player 11)
    bitmap.draw function somehow conflicts with the appendBytesAction or appendBytes
    this question is posted  on ActionScript 3.0 forum before
    http://forums.adobe.com/message/4650890#4650890
    http://flash.bigresource.com/flash-use-BitmapData-draw-with-NetStream-appendBytes--iTNz6LV JM.html
    http://stackoverflow.com/questions/5607047/how-can-i-use-bitmapdata-draw-with-netstream-ap pendbytes

  • BitmapData.draw() and embedded MovieClip

    I can't capture the content of an embedded MovieClip, the
    following code creates a Bitmap that shows only the results of the
    changes methods of Graphics, although the clip is correctly
    embedded. Have you tackled similar problems? Thanks.
    [Embed(source="aMovieClip.swf")]
    private static var AMovieClip:Class;
    var aMovieClip:MovieClip = new AMovieClip();
    aMovieClip.graphics.lineStyle(6, 0xff0000);
    aMovieClip.graphics.lineTo(100,100); //i don't need this, but
    this is the only things that you will see, a red line
    var bitmapData:BitmapData = new BitmapData(aMovieClip.width,
    aMovieClip.height,true, 0xFFFFFF);
    bitmapData.draw(aMovieClip);

    It seems that the functions that were failing were
    getBounds() and accessing the transform.concatenatedMatrix in the
    loaded swf in the process of preparing to draw the bitmap.

  • BitmapData.draw() and displayobject with 3D transformations

    Hi all,
    I have a sprite with some objects in it which are transformed in 3D (positioned and rotated). The objects form a coneshape in such a way that the objects that make up the back are hidden.
    When I use that sprite as a source for the bitmapData.draw() it is drawn from another viewpoint so it seems. In my case the copy is viewed slightly from the bottom and right.
    Bottomline:
    Does anyone know of a way to duplicate the image of a sprite which contains 3D manipulated graphics?
    thanks in advance,
    Manno

    Nevermind:
    var pp:PerspectiveProjection = new PerspectiveProjection();
    pp.projectionCenter = new Point( 0, 0 );
    sphere.transform.perspectiveProjection = pp;
    Where sphere is the object to use as a source in the draw method. It seems OK now it has it's own perspectiveProjection set.

  • BitmapData.draw and clipRect

    Hello,
    I'm writing a sprite animation system that requires
    transformations on individual sprites that are stored as BitmapData
    sprite sheets.
    I've been using BitmapData.draw to do my work - which has
    worked well for individual bitmap files, but when it comes to
    transforming only a piece of a bitmap, which is what clipRect is
    supposed to do according to the documentation, it doesn't work.
    It looks like clipRect is actually the clipping region for
    the destination not the source. I'm wondering there's any function
    that does source clipping before transform to destination.
    Otherwise, I fear I'm going to have to use an intermediate
    bitmapData to copy my frame of the sprite to before I transform it.
    Regards!

    Nope, you just have to do it in 2 steps it looks like.

  • Bitmapdata.draw and stage3D

    I have a script that uses a lot of complicated .draw calls with matrix transformation (scale and shift), displaying different parts of a big image (thousands by thousands px) in a kind of navigatior window.
    Currently it's done in "old" AS3 for FP10. Is there a way to speed these calls up using GPU and stage3D in the new player FP11?
    Can GPU help with that kind of image manupulation?

    Good news, thank you!
    Can anyone tell me what could be a Stage3D equivalent of this:
    var img:BitmapData = .......
    var rgn:Rectangle = ........
    var scl:Number = ....
    var matrix:Matrix = new flash.geom.Matrix();
    rgn.x *= scl;
    rgn.y *= scl;
    rgn.width *= scl;
    rgn.height *= scl;
    matrix.scale(scl,scl);
    matrix.tx = -rgn.left;
    matrix.ty = -rgn.top;
    var mapBD:BitmapData = new BitmapData(rgn.width,rgn.height,false,0x000000);
    mapBD.draw(img,matrix,null,null,new Rectangle(0,0,rgn.width,rgn.height),true);
    var mapLayer:Bitmap = new Bitmap(mapBD);

  • Still cannot use BitmapData.draw from RTMP sources?

    I have been trying all different ways to capture RTMP streams from my local FMS3.5 server but no luck... then I read this:
    "For media loaded from RTMP sources, you cannot use the BitmapData.draw() and SoundMixer.computeSpectrum() methods to extract run-time graphics and sound data. "
    is this still true? If so, is there any way around this?
    Thx!

    You will get a better luck if you post this question on media server forum:
    http://forums.adobe.com/community/adobe_media_server?view=discussions

  • BitmapData.draw Security Sandbox and LocalTrusted not working?

    Hello there, wondering if anyone else is having the same
    problem -- I have a LocalTrusted security sandboxType -- and when i
    try to access a BitmapData.draw method on a progressive flv, i get
    the error message:
    SecurityError: Error #2135: Security sandbox violation:
    BitmapData.draw: file://file.swf may not access null. RTMP content
    cannot be accessed using this API.
    I've rechecked my sandbox type a zillion times, as well as
    tried putting allow="*" in the crossdomain policy file ....
    is this an error in my security settings -- or is
    bitmapdata.draw on video objects now "gone"?

    Could you try this - Open and swf, rightClick - Goto
    settings, then click Advanced. On the webPage click on "Global
    Security settings panel".
    If you don't find your local directory in there, add it and
    see if things work?
    If not, it would be good if you could post the chunk of code
    which is creating problems.

  • Security issue with NetStream.appendBytes() and BitmapData.draw()

    Iuse appendBytes to continuously and seamlessly stream video data into a netStream. since we're NOT playing the video files directly from a web domain, there is no meaning to the checkPolicyFile property of our netStream object and therefore - we cannot BitmapData.draw() our Video instance with the netStream attached.
    Is there any possibility to get images from the netStream in order to manipulate them on-the-fly?

    I ran into the same problem.  Have you managed to find a solution to get around the security violation?

  • BitmapData.draw problem due to security

    As another thread has posted, there seems to be a problem for BitmapData.draw on the Stratus server.
    After connecting to the Stratus server, drawing any part of the UIComponents will be stopped by a security alert.
    Event after disconnecting to Stratus, the problem still exist.  The only time when BitmapData.draw worked is when
    the application just lunched and havn't connect to Stratus yet.
    I've found another thread in the LCCS forum discussing the same problem, and it seems that over there they found a solution.
    Just wondering of Stratus will apply the same fix or do we have to wait until the new edition of FMS to have this fixed.
    Thanks in advance
    The LCCS forum thread discussing this problem:
    http://forums.adobe.com/message/2803074#2803074

    Hi,
    If you haven't already, I suggest opening a ticket with customer support.
    Jennie

  • BitmapData.draw Security error

    I am drawing to bitmap from MediaContainer:
    var mediaContainer:MediaContainer = new MediaContainer();
    bitmapData.draw(mediaContainer);
    This works, but when I switch video, an error occurs:
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw
    cannot access unknown URL. No policy files granted access.
    Any ideas?

    Here you go:
    http://flashboard.info/files/DrawTest.fxp
    It has both HTTP and RTMP ways.
    I've tried launching from http:// and file:// - both work fine for me.
    Links inside app are to our production servers.
    Regards!

  • LOCAL_WITH_NETWORK sandbox and SecurityError: Error #2121: BitmapData.draw

    We have an application we run in a localWithNetwork security sandbox.  This application loads many assets from an off-site web server.  In spite of a very permissive crossdomain.xml, swfs downloaded from site give a 2121 error when we convert them to bitmaps at runtime.
      <?xml version="1.0" ?>
      <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
      <cross-domain-policy>
        <allow-access-from domain="*" />
        <site-control permitted-cross-domain-policies="all"/>
      </cross-domain-policy>
    Now, I understand why this restriction with BitmapData.Draw exists in general, and from what I've read in other discussion threads the general solution is to allow less restrictive access via crossdomain.xml.  This is the most permissive I know how to make it, although the documentation on the subject is not the most concise.  Are there details I'm missing here?
    For the moment we're just running this as LOCAL_TRUSTED, but this requires folks to be setup with the debug plugin which is a maintenance problem.
    Thanks in advance for any guidance.
    jv

    Crossdomain isn’t used in localWithNetwork because there is no “domain” for the request.
    I didn’t think you needed a debug plugin for LOCAL_TRUSTED, I thought any trust file would work.  Did you try creating an AIR app instead?  It might have different security rules.

  • Security Sandbox violation bitmapData.draw() cant access null

    very strange.  I am testing with two different HD streams.  One an akamai stream and another one of our clients not on akamai and using an F4M manifest file.  I have tried allowing the domain and they have a crossdomain.xml file on their side but i still get this error.  
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://web.mobilerider.com/flash/osmflive/OSMF_Live.swf?mediaID=190&vendorID=513&extras=vs :1,skin:osmf_live,muteOn:0,autoplay:1,live:1,showArchive:1,&serviceID=2&jsID=1316213568052 cannot access null. No policy files granted access.
    any help would be very appreciated, thanks

    Hello!
    This seems to be relevant:
    http://forums.adobe.com/message/3759490#3759490

  • SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: cannot access

    When we try to print the Google Map API for Flash component, it is throwing the Security Sandbox Violation
          SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://ps6143:8080/aa/XYZ/Main.swf/[[DYNAMIC]]/1 cannot access  http://mt1.google.com/vt/lyrs=m@171000000&hl=en&src=api&x=1&y=1&z=1&s=Gali&flc=x3t. No policy files granted access.
    at flash.display::BitmapData/draw()
    To avoid this error we tried to use the alternate API provided by library. But that also causing cross domain issue as it loading some 3d library internally which is not able to access our application.
    SecurityError: Error #2121: Security sandbox violation: BitmapData.draw: http://maps.googleapis.com/mapfiles/lib/map_1_20_10_3d.swf cannot access http://ps6143.persistent.co.in:8080/dv/SiteOptimizer/SiteOptimizer.swf/%5b%5bDYNAMIC%5d%5d /1http://ps6143:8080/aa/XYZ/Main.swf/[[DYNAMIC]]/1. This may be worked around by calling Security.allowDomain.
    at flash.display::BitmapData/draw()
    Please help us in resolving this issue.
    Thanks & Regrds,
    Ravi Darji

    There is no redirect... Charles is a web proxy so it will look completely legitimate to the browser.
    According to the help, it's getting the access request from the SWF itself and not the crossdomain.xml file:
    In the case of a source object other than a loaded bitmap, the source object and (in the case of a Sprite or MovieClip object) all of its child objects must come from the same domain as the object calling the draw() method, or they must be in a SWF file that is accessible to the caller by having called the Security.allowDomain()method.
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7d1b.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7c4a
    So the default state accessing a SWF on a different domain is protected, unless that SWF allows some or all domains to access it via the Security.allowDomain() method.

  • 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.

Maybe you are looking for

  • 2nd time asking.......Pureplay Poker site is being redirected, hacked by facebook, and downloading trojans, etc....can this be prevented?? in English

    2nd time asking.......Pureplay Poker site is being redirected, hacked by facebook, and downloading trojans, etc....can this be prevented?? in English == URL of affected sites == http://player.pureplay.com

  • IBook Not Going To Sleep

    I set it to go to sleep after 10mins but the display turns off, and it just stays like that. When I touch the track-pad I have to put my password in, before it was setup the same way but i dont know whats going on, and its killing my battery. I just

  • How to determine vendor minority indicator / status

    We are using a manual process to update vendor minority indicator. Is there a service out there to automate the process? Is there a vendor (Dun Bradstreet) who can provide periodic updates based on vendor account number? Any input is welcome.

  • Adjustment Brush Problem

    Dear all, I have problem with my lightroom application. The edited point after using adjustment brush didn't appeared after i locked the editing. Its hard to change the editing because the point not apeared and i cant controlmy editing after dat beca

  • Ipad wont sync to pc

    I have tried to sync my Ipad to my pc and it wont apply the movie I paid for on itunes it comes up with error and saying some item in itunes Libary could be copied as they could not be found, i have changed cords but i dont have any problems with my