2011-08-29 74 views
0

我正在研究現有的Flash項目(基於Flash的遊戲),我需要集成社交登錄小工具Gigya。我使用Adobe Flash Platform Services Social進行了研究並最終完成。Flash錯誤 - 安全沙盒違例 - 在Flash中集成Gigya

問題是,我成功地將它集成到我最初準備的測試Flash文件中。但是,當我在我的實際Flash項目的源文件中集成它,我得到以下錯誤:

*** Security Sandbox Violation *** 

SecurityDomain 'http://cdn.gigya.com/wildfire/WFApi.ashx?f=gs&asver=as3&service=socialize&enabledProviders=facebook%2Ctwitter%2Cyahoo%2Cmessenger%2Cgoogle%2Clinkedin%2Cmyspace%2Caol%2Corkut%2Cwordpress&services=socialize&APIKey=[---myApiKey---]' tried to access incompatible context 'file:///D|/FlashProjects/game.swf' 

SecurityError: Error #2070: Security sandbox violation: caller http://cdn.gigya.com/wildfire/WFApi.ashx?f=gs&asver=as3&service=socialize&enabledProviders=facebook%2Ctwitter%2Cyahoo%2Cmessenger%2Cgoogle%2Clinkedin%2Cmyspace%2Caol%2Corkut%2Cwordpress&services=socialize&APIKey=[---myApiKey---] cannot access Stage owned by file:///D|/FlashProjects/game.swf. 

at flash.display::Stage/requireOwnerPermissions() 
at flash.display::Stage/addEventListener() 
at com.Gigya.Lib::FixFocusManagerBugs/addFocusInAndOutHandlers() 
at com.Gigya.Lib::FixFocusManagerBugs/onUiTopElementAddedToStage() 
at flash.display::DisplayObjectContainer/addChild() 
at com.Gigya.Apps.Socialize.Common::BaseForm() 
at com.Gigya.Apps.Socialize.Login.Forms::MiniLogin() 
at com.Gigya.Apps.Socialize.Login::LoginApp/showLoginUI() 
at com.Gigya.Lib::ExternalClassLoader/onSwfLoaded() 
at com.Gigya.Lib::ExternalClassLoader/ecl_INIT() 

請注意,我也包括 的Security.allowDomain(「cdn.gigya.com」);我的代碼中有 ,但它在我的初始測試Flash(最小文件有2個框架,沒有額外的組件)中工作,但似乎不適用於我的實際遊戲Flash。

有沒有人遇到過這樣的錯誤?

請幫我一把。

謝謝。

回答

0

我將每個框架和相關的actionscript代碼一個接一個地整合到我的flash文件中,看到包括一個框架導致這個問題,我刪除它,運行flash文件,一切都很完美。

還不確定問題是如何發生的,但現在不再發生了:)

0

我假設你正在加載SWF,並且SWF需要訪問加載器(遊戲)階段?在這種情況下,嘗試指定,他們是在同一個應用程序和安全域時,您加載它:

var loader : Loader; 
var context : LoaderContext; 

context = new LoaderContext(true, ApplicationDomain.currentDomain, 
            SecurityDomain.currentDomain);  

loader = new Loader(); 
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoaderComplete); 
loader.load(new URLRequest(url), context); 

這應該在SWF加載到相同的應用程序域調用者,這應該讓他們既能訪問彼此。