843 posts
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+2 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
  • United States
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
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 50 000 and 100 000 dollars
  • United States
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
  • Author had a Free File of the Month
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 1 and 9 users
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()

8119 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Netherlands
  • Referred between 10 and 49 users
  • Sold between 5 000 and 10 000 dollars
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Germany
  • Has been a member for 3-4 years
  • Sold between 1 000 and 5 000 dollars
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
  • Beta Tester
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
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
  • Envato Staff
  • Reviewer
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
+4 more
RimmonTrieu Reviewer 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