843 posts
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
marcfolio says

I’m loading a swf into my main file and I’ve come down to the conclusion that because this sub swf has content that’s created using graphics.drawRect I get the above security error.

Does anyone know how I can get past it?

556 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
ThemeScience says

I’m loading a swf into my main file and I’ve come down to the conclusion that because this sub swf has content that’s created using graphics.drawRect I get the above security error. Does anyone know how I can get past it?

Did you try importing the library into your Main SWF , and not just the child swf? I would try that .

1234 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
+5 more
MBMedia says

If you have access to both swf’s security errors can be avoided. You need to use the Security.allowDomain method to allow each swf’s domain to access the scripts inside each other. Which swf needs to do the allowing depends on your setup, but if both allow each other then you’ve avoided most sandbox problems. Google Security.allowDomain and there’s a ton of resources on it.

56 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashdrone says

Are you using bitmapdata’s draw function on the sub swf?? If yes and the sub swf is from other domain then the sandbox violation error will occur:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw()

8251 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Volunteer moderator says

I think it may be the above, you can’t use bitmap.draw() on content from another domain…

1955 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
Emroni says

I think it may be the above, you can’t use bitmap.draw() on content from another domain…

+1 Take Youtube for example. I once tried to use the Youtube player with Papervision but couldnt, cause of the violation created by bitmapdatas draw()

31 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
dreamcorp says

Hello guys, your replies are very helpfull, was experiencing the same problem.

Please suggest how to use bitmap.draw() on content from another domain, from my RED5 server.

I want to make some effects on video streaming from RED5 server. What can be solution? Thanks

535 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
dimumurray says

Here’s the description of the BitmapData::draw() method from the online ActionScript Reference :

Draws the source display object onto the bitmap image, using the Flash runtime vector renderer. You can specify matrix, colorTransform, blendMode, and a destination clipRect parameter to control how the rendering performs. Optionally, you can specify whether the bitmap should be smoothed when scaled (this works only if the source object is a BitmapData object).

This method directly corresponds to how objects are drawn with the standard vector renderer for objects in the authoring tool interface. The source display object does not use any of its applied transformations for this call. It is treated as it exists in the library or file, with no matrix transform, no color transform, and no blend mode. To draw a display object (such as a movie clip) by using its own transform properties, you can copy its transform property object to the transform property of the Bitmap object that uses the BitmapData object.

This method is supported over RTMP in Flash Player 9.0.115.0 and later and in Adobe AIR . You can control access to streams on Flash Media Server in a server-side script. For more information, see the Client.audioSampleAccess and Client.videoSampleAccess properties in Server-Side ActionScript Language Reference for Adobe Flash Media Server.

If the source object and (in the case of a Sprite or MovieClip object) all of its child objects do not come from the same domain as the caller, or are not in a content that is accessible to the caller by having called the Security.allowDomain() method, a call to the draw() throws a SecurityError exception.

This restriction does not apply to AIR content in the application security sandbox.

There are also restrictions on using a loaded bitmap image as the source. A call to the draw() method is successful if the loaded image comes from the same domain as the caller. Also, a cross-domain policy file on the image’s server can grant permission to the domain of the SWF content calling the draw() method. In this case, you must set the checkPolicyFile property of a LoaderContext object, and use this object as the context parameter when calling the load() method of the Loader object used to load the image. These restrictions do not apply to AIR content in the application security sandbox.

On Windows, the draw() method cannot capture SWF content embedded in an HTML page in an HTMLLoader object in Adobe AIR . The draw() method cannot capture PDF content in Adobe AIR . Nor can it capture or SWF content embedded in HTML in which the wmode attribute is set to “window” in Adobe AIR .

After reading that bit about restrictions I’m thinking all you need is to setup a cross-domian policy XML on the server from which the SWF originated. This assumes, of course, that you have access to that server.

1633 posts fueledweb.com
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
RimmonTrieu says

Hello guys, your replies are very helpfull, was experiencing the same problem.

Please suggest how to use bitmap.draw() on content from another domain, from my RED5 server.

I want to make some effects on video streaming from RED5 server. What can be solution? Thanks

If it’s your own server a crossdomain.xml will usually does the trick. If you don’t have access to server that has the content there will be much more restrictions, try to setup a proxy script using php or related server side language to pull the content first.

by
by
by
by
by
by