SecurityError: Error #2123: Security sandbox violation: BitmapData.draw:

846 posts
  • Top Monthly Author
  • Weekly Top Seller
  • 7 Years of Membership
  • Author Level 7
+9 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
  • 5 Years of Membership
  • Affiliate Level 2
  • Author Level 3
  • Collector Level 2
+5 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
  • 6 Years of Membership
  • Affiliate Level 3
  • Author Level 7
  • Collector Level 3
+7 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
  • 5 Years of Membership
  • Affiliate Level 1
  • Collector Level 1
  • Exclusive Author
+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()

8586 posts Community Moderator
  • United Kingdom
  • 7 Years of Membership
  • Moderator
  • Winner
+10 more
MSFX
Moderator
says

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

1955 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Author Level 4
  • Collector Level 2
+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
  • 4 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+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

1633 posts fueledweb.com
  • Affiliate Level 2
  • Author Level 8
  • Collector Level 2
  • Top Monthly Author
+8 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