0
默認情況下,如果遠程服務器未添加策略文件,則無法訪問或平滑來自遠程域的圖像。我記得在另一個項目中,我們能夠在這些情況下實現平滑。我們必須將遠程域設置或添加到受信任的域陣列。我沒有這個代碼了,我不記得我們是如何做到的。有人知道我在說什麼以及如何啓用它嗎?如何將平滑添加到來自外部源的Spark圖像
更多的上下文
將此代碼添加到您的Flex應用程序:
<s:Image id="myImage" source="https://www.google.com/images/srpr/logo3w.png" smooth="true" height="200" width="400" />
,並在瀏覽器中運行它。如果你從file://運行它,它應該顯示平滑的圖像。
這是因爲Flash Builder在開發過程中給它特殊的權限。如果你把它的服務器上,例如,http://localhost:8888/Project-debug/Project.html
,你會看到它不平滑和錯誤控制檯中顯示:
Error: Request for resource at https://www.google.com/images/srpr/logo3w.png by requestor from http://localhost:8888/Project-debug/Project.swf/[[DYNAMIC]]/3 is denied due to lack of policy file permissions.
*** Security Sandbox Violation ***
Connection to https://www.google.com/images/srpr/logo3w.png halted - not permitted from http://localhost:8888/Project-debug/Project.swf
Error: Request for resource at https://www.google.com/images/srpr/logo3w.png by requestor from http://localhost:8888/Project-debug/Project.swf/[[DYNAMIC]]/3 is denied due to lack of policy file permissions.