2011-03-13 30 views
2

我在嘗試使用從Flash CS5導入的「swc」文件時遇到了一個非常奇怪的問題,我嘗試在Flex Builder 3中使用它(由將符號轉換爲「Flex組件」)。這些錯誤即將發生在與我正在導入的「swc」文件無關的文件中。在從Flash CS 5導入swc時Flex Builder 3中的自動化錯誤

現在,我知道自動化的東西已經成爲FB4的一部分,但我沒有選擇遷移到FB4。

我試圖改變Flash CS5中的flex sdk設置(下面給出的步驟),但這並沒有幫助。 編輯 - >首選項 - >動作腳本 - >「動作腳本3.0設置」 - >「Flex SDK路徑」(指向這個flex3.5 sdk而不是Flex4.0 sdk)

我覺得這個問題最有可能是Flex 3和Flex 4的兼容性問題,但尚未找到相同的解決方法。任何幫助是極大的讚賞。

感謝, 卡皮爾

這裏是跟蹤:

Severity and Description Path Resource Location Creation Time Id 
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.view.ui:SchematicWindow. 
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.controls:CloseableTabBar.  
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.layouts:DockedAppLayout. 

回答

0

OK,首先,錯誤:這意味着Flash可能產生一個類你正在使用某種模板導入符號,模板不適合您用於編譯項目的SDK。具體而言,生成的類沒有實現錯誤消息中列出的方法。即您framework.swc有mx.automation的定義:)IAutomationObject有方法createAutomationIDPartWithRequiredProperties((好聽的名字順便說一句),但是Flash生成的代碼,其中顯示

package com.sparsha.view.ui { 
import mx.automation:IAutomationObject; 
public class SchematicWindow implements IAutomationObject { . . . } } 

既然你不能做任何的Flash不產生方法你需要,你唯一的方法就是修改SDK。即將SDK源中的mx/automation/IAutomationObject.as複製到項目的類路徑中。刪除衝突的方法聲明(這可能會或可能不會導致其他錯誤)。如果它導致進一步的錯誤,重複相同的程序,以「行爲不端」的每個類...

然而,monkeypatching將意味着你不再能夠使用框架RSL,因爲他們將與原始版本。所以,我會嘗試完全避免這個問題,並尋找另一種從Flash IDE中導出符號的方式,例如,通過不使它們成爲Flex組件。或者,如果您確實堅持要將它們作爲Flex組件,則例如引導FlexSprite,並將您的Flash符號分配爲自舉類作爲「父類」。

+0

嗨Wvxw ....感謝您的回覆。我們終於設法繞過了從Adobe CS4創建SWC文件的問題.....我們現在正在遷移到FB4 ....所以希望這不會是一個問題! – 2011-10-24 15:40:52

0

我最近也遇到這個問題。當我將flex生成的swc包含在flex項目庫文件夾中時,我會得到這些錯誤。

我能夠通過將我的flex升級到flex 4.5.1.21328A SDK來解決此問題。

有關我的項目可能有助於他人的其他詳細信息: 我的swc是從Flash Professional CS5.5生成的,我的Flex項目正在Flash Builder 4.5中使用。

我的swc使用ActionScript 3.0發佈到Flash Player 9。 我的Flex項目使用的是3.5.0.12683 SDK。

相關問題