我有一個靈活的應用程序(「MyApp」)我正在努力在哪裏我看到一些非常奇怪的和不一致的錯誤。其中一個錯誤,我有時會立即看到應用推出的是什麼導致Flash/actionscript運行時錯誤「WatcherSetupUtil未定義」?
"Variable _MyAppWatcherSetupUtil is not defined."
完整的錯誤輸出是問題的底部。
是什麼讓這個錯誤特別奇怪是我在做一個項目構建後立即獲得它(即:多次運行swf並且它總是發生),並且我需要做的唯一事情就是讓錯誤發生(我不會說「修復它」)是再次構建項目。
有誰知道這個錯誤是關於什麼的?目前爲止我能收集到的最好的東西是,它可能與綁定變量有關(這是WatcherUtil似乎暗示的),但我不明白爲什麼它會在構建之間不一致。
編譯時使用flex_sdk_4.5.0.20967中的mxmlc。對於最近的構建在那裏發生
完整的錯誤輸出:
Exception thrown: ReferenceError: Error #1065: Variable _MyAppWatcherSetupUtil is not defined. at global/flash.utils::getDefinitionByName() at MyApp()[C:\code\Sandbox\MyApp\src\MyApp.mxml:6] at _MyApp_mx_managers_SystemManager/create()[_MyApp_mx_managers_SystemManager.as:50] at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\systemClasses\ChildManager.as:311] at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:3063] at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2849] at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2729] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.preloaders::Preloader/timerHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\Preloader.as:542] at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()
每J_A_X要求更新..:
第7行MXML文件是:
<?xml version="1.0" encoding="utf-8"?>
<s:Application height="100%" width="100%"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
initialize="InitData();">
<fx:Script source="MyApp.as"/>
InitData()代碼(與其他相關的腳本行)位於MyApp.as文件中:
import classes.RpcServerProxy;
public var SP:RpcServerProxy;
public function InitData():void {
SP = new RpcServerProxy("http://192.168.1.102:1234");
}
我想你的代碼中的東西正在造成這種情況,但奇怪的是,堆棧跟蹤中沒有任何東西是自定義組件。 WatchterUtils確實與綁定有關。 – JeffryHouser 2011-06-07 14:10:32
我在項目中有一個自定義(和複雜的)純動作類,但我沒有做任何可綁定的操作。感謝您確認綁定關係。對於我來說,最棘手的問題就是構建與構建不一致...... – Russ 2011-06-07 14:16:00
如果它是純粹的ActionScript項目,爲什麼你用Flex標記這個?你在使用Flex組件嗎? – JeffryHouser 2011-06-07 14:21:01