I have a flex screen that I want to capture into a bitmap using the
technique that Andrew Trice described earlier this week.

it works as so:

<codeExample1>

private function getUIComponentBitmapData(target:UIComponent):BitmapData{
    var bd : BitmapData = new BitmapData( target.width, target.height );
    var m : Matrix = new Matrix();
    bd.draw(target,m);
    return bd;
}
</codeExample1>

I am feeding that function a UIComponent that contains an image that
looks like this:

<codeExample2>

<mx:Image  id="picture"
        verticalAlign="middle"
        horizontalAlign="middle"
        source="{model.picture_http}" width ="200" height="200"/>

</codeExample2>

The problem is that the model.picture_http is on another domain.
The error I get is as follows:

<error>
SecurityError: Error #2122: Security sandbox violation:
BitmapData.draw:
http://localhost:8080/elroyServer/songmail/songmail-debug.swf cannot
access http://storage.elroynetworks.com/092233720368547758070000000044.
A policy file is required, but the checkPolicyFile flag was not set
when this media was loaded.
</error>

This seems to suggest that I need a crossdomain.xml file, which is
fine. I have that, and I believe it is in the right place. The problem
is I am supposed to set a checkPolicyFile flag. The doc's explain how
to do this, but not in the context of Flex. The docs say:

<docs>
When you load the image using the load() method of the Loader class,
you can specify a context parameter, which is a LoaderContext object.
If you set the checkPolicyFile property of the LoaderContext object to
true, Flash Player checks for a cross-domain policy file on the server
from which the image is loaded. If there is a cross-domain policy
file, and the file permits the domain of the loading SWF file, the
file is allowed to access data in the Bitmap object; otherwise, access
is denied.

You can also specify a checkPolicyFile property in an image loaded via
an <img> tag in a text field. For details, see Loading SWF files and
images using the <img> tag in a text field.
</docs>

I dont know how one would use the "load() " command from MXML.
Moreover, I would really like an MXMLish way to deal with cross domain
issues.

Has anybody dealt with this?

Hank


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to