Fix for: Permission denied to access property 'toString'

Originally posted by rwolffgang here.

Hi guys,
when developing a game that runs in an iframe (Facebook canvas) I encountered this error message in the JavaScript console:

Permission denied to access property ‘toString‘

I‘m using the Flash plugin and it turned out to be a security mechanism of Flash, which disallows to pull content from another domain. Although the Flash plugin and MP3s are hosted on the same domain, the iframe let‘s Flash consider it as a cross-domain access. The domain, from which the content should be downloaded, needs to allow the access.

To solve this issue I had to place a crossdomain.xml file in the root of our domain.

<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" />
    <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
I know this is not an error report, but I‘m certain someone else will hit the same problem, hence I want this knowledge to be shared.

Cheers,
Robert

Sources:

http://willperone.net/Code/as3error.php

https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

 

from: http://community.createjs.com/discussions/soundjs/136-fix-for-permission-denied-to-access-property-tostring

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。