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.

Similar Messages

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

  • 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

  • HTTP Streaming and BitmapData.draw

    Hi OSMF Experts,
    I've tried to duplicate segments of a Video with BitmapData.draw.
    It's working with RTMP (set videoSampleAccess server side).
    Progressive is also working (crossdomain.xml is ok).
    BitmapData.draw doesn't work with HTTP Streaming! (Using *.f4m). What's the way to get this working? Following Error is thrown:
    SecurityError: Error #2123: Verletzung der Sicherheits-Sandbox: BitmapData.draw: file:///C|/players/myVideoTestHTTP.swf kann nicht auf null zugreifen. Es haben keine Richtliniendateien Zugriff gewährt.
    I've used OSMF 2.0 for the Tests. And I've testet with the sample.mp4/manifest.f4m example.
    Thanks for your answers.
    Greets
    Martin

    Have you seen bug CSCdx31582- Macintosh wont play WMT from CE (ecdn). Guess this is similar to the issue that you have.

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

  • 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 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 failed on WebcamSubscriber

    Most of the times when I try to snap data from WebcamSubscriber movieclip I get the following error.
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: mypath.swf cannot access rtmfp://fms7.acrobat.com/cocomo/na2-sdk-bec0edb4-775b-4f16-94f7-cd43ec89ff10/test. No policy files granted access.
    in some (very few) cases it works, and I can feagure out what are the conditions require for it to work.
    Few weeks ago it was working consistently.
    Will appreciate any help.
    Best regards,
    Gadi Srebnik

    Great, bitmapdata.draw works good !
    however, it didnt happened when I removed the protocol decleration on my previous room/application. When I tried that it tried to connect to fms8 and only when I started a new application/room and removed the protocol declaration it changed to fms4 and it works fine now.
    Does it have anything to do with the specific server node?
    how can I be sure that user connection will allways run on the server that will enable this feature?
    btw, the subscribe from dev panel also work now all the time
    Best Regards,
    Gadi Srebnik

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

  • How to clean the memory after calling BitmapData.draw() ?

    If you add the embedded image on the Stage 800x600 flash player will spend 17Mb RAM / 14Mb Virtual
    But if you create 1200 sprites (in every 100 circles), call draw (), remove the sprites and force to call Garbage Collector, flash player will spend much more - 36Mb RAM / 33Mb Virtual
    var container:Sprite = new Sprite();
    // adding 1200 sprites
    var shiftX:Number = 10;
    var shiftY:Number = 10;
    for (var i:int = 0; i < 1200; i++) {
         var circle:Sprite = new Sprite();
         // drawing 100 circles
         for (var j:int = 0; j < 100; j++) {
              circle.graphics.beginFill(0xFFFFFF/j*i);
              circle.graphics.drawCircle(0, 0, 10-j*.1);                        
         circle.x = shiftX;
         circle.y = shiftY;
         shiftX += 20;
         if ( shiftX >= stage.stageWidth ) {
              shiftX = 10;
              shiftY += 20;
         container.addChild(circle);
    // draw() and adding bitmap
    var bmd:BitmapData = new BitmapData(800, 600, true, 0x00FFFFFF);
    bmd.draw(container);
    var bmp:Bitmap = new Bitmap(bmd, "auto", true);
    addChild(bmp);
    // removing sprites
    while (container.numChildren) container.removeChild(container.getChildAt(0));
    // Force Garbage Collector 1
    System.gc();
    System.gc();
    // Force Garbage Collector 2
    try {
         new LocalConnection().connect('foo');
         new LocalConnection().connect('foo');
    } catch (e:Error) {}
    What happens to memory?

    Is there any issue with JavaFX? or I have to do something else?It's likely an issue with your application code (though it could be a bug in the JavaFX platform too).
    Either way debugging most memory issues in JavaFX (except for ones the graphics card texture related) is the same as debugging them in Java - so just use standard Java profiling tools to try to track down any memory leaks you have.
    Such work is as much an art as a science and takes some experience to get right, so grab your detective cap, download and use the tools linked and try and track it down:
    http://stackoverflow.com/questions/6470651/creating-a-memory-leak-with-java
    http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/helptopics/memory/memoryLeak.html
    http://www.ej-technologies.com/products/jprofiler/overview.html (recommended tool).
    http://visualvm.java.net/
    http://netbeans.org/kb/articles/nb-profiler-uncoveringleaks_pt1.html
    http://www.ibm.com/developerworks/library/j-leaks/ (this link is really old and somewhat outdated but explains some of the underlying concepts better than some newer articles I found).

  • 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

  • Getting Security Error when trying to use bitmapdata.draw method on youtube videos

    Hi All ,
    I am playing youtube videos in UIComponet of flex, but when I trying to capture the image using bitmapdata.draw() method it gives me an secutity error on server  , It works well locally in flex editor.
    Is any one knows how to resolve this bug??
    Thanks in advance
    sujit Rai

    Try nesting the clips and then adding the warp stabiliser to the nest.

Maybe you are looking for

  • How do we Prevent Creation of Production Orders for Phantom materials.

    Dear Experts; We have some materials which are Phantoms. We have set "special procurement type" as 50 in MRP2 and "Strategy Group" as 59 in MRP3 These are non stchable items, but have BOMS. We dont create orders for them, however at the mement the sy

  • What format do I use to upload a 5 min. movie to a website?

    What 'format' in the drop down options do I use if I want the video to be flash on the website? ie: wave, FLC..... Any other settings that I should have as presets? - fps? - Quality? - Size? Thanks in advance!

  • FCP 7.0.3 Snow Leopard CRASH!

    I got a lot of crash with Final cut Pro 7 theses time.... I think it comes from a big projects with differents video codecs. but it also crash on Apple Pro Res files.... I am working on a Mac Pro 3,1 (2 x 3Ghtz Quad-Core Intel Xeon) - 8Go RAM DDR2 -

  • Digital Signatures per page rather than per document

    I am looking for some type of solution allowing for digital signatures for pdf files using a certificate authority. These documents will have signatures on each page. Am looking for a solution which would be able to validate on a page-by-page basis r

  • How to process images(Zooming) in java

    Hai, In our project,i need to provide an option to the end user to zoom the image, i am able to provide options like rotating an image and flipping an image using java image processing API. If anybody has already visited the website http://photo.stam