What causes the flash / actionscript runtime error "WatcherSetupUtil not defined"?

I have a flex application ("MyApp"). I am working on where I see some very strange and inconsistent errors. One of the errors that I sometimes see right away when I launch the application is

"Variable _MyAppWatcherSetupUtil is not defined." 

The full conclusion of the error is at the bottom of the question.

What makes this error especially strange is that I get it immediately and sequentially after completing the build of the project (i.e., I run swf many times, and this always happens), and the only thing I need to do to make the error disappear (I I will not say β€œfix”) to re-create the project.

Does anyone know what this error is? So far, the best I can collect so far is that it could be related to the bound variables in some way (which WatcherUtil seems to imply), but I don't understand why this would be inconsistent between assemblies.


Compiling with mxmlc from flex_sdk_4.5.0.20967.

Full error output for a recent build where this happened:

  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 ()

Update for J_A_X ..:

The first 7 lines of the MXML file:

 <?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"/> 

And the InitData () code (with other relevant script lines) is in the MyApp.as file:

 import classes.RpcServerProxy; public var SP:RpcServerProxy; public function InitData():void { SP = new RpcServerProxy("http://192.168.1.102:1234"); } 
+6
source share
1 answer

I do not know what RpcServerProxy , but it can do something before everything is created. Instead of calling a function in an initialization event, use createComplete instead.

You can always look at the code inside this class because it definitely does something funky.

+4
source

Source: https://habr.com/ru/post/889963/


All Articles