My application can not read resources when using this static references
while it was working in flex and I faced this error while trying to
prepare a test case about the bug related with this case.
I may file an issue as you advise.
Thanks,
Serkan
-------- İletilmiş İleti --------
Konu: Re: WARNING
Tarih: Fri, 1 Nov 2019 21:30:34 +0000
Kimden: Alex Harui <[email protected]>
Kime: Serkan Taş <[email protected]>
We can try to fix the compiler output. I’m saying that is probably what
is blocking you right now. Feel free to open an issue with a small test
case.
-Alex
*From: *Serkan Taş <[email protected]>
*Date: *Friday, November 1, 2019 at 2:28 PM
*To: *Alex Harui <[email protected]>
*Subject: *Re: WARNING
When I define the static reference in another class and call it in the
mxml component it works in my original flex application.
From here,
1. I understand I should redesign it for royale.
2. Shouldn't be handled in the compiler step as an error rather than
warning ?
Thanks,
Serkan
2.11.2019 00:20 tarihinde Alex Harui yazdı:
It may not work to define static constants from ResourceManager.
HTH,
-Alex
*From: *Serkan Taş <[email protected]>
<mailto:[email protected]>
*Reply-To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Date: *Friday, November 1, 2019 at 1:47 PM
*To: *"[email protected]" <mailto:[email protected]>
<[email protected]> <mailto:[email protected]>
*Subject: *WARNING
Hi,
Need and advice, I am getting a compiler warning that appears as an
exception in web console :
WARNING:
D:/dev/royale-emulation-works/github/royale-testing/src/main/mtest/bin/js-debug/main/mtest/FindBug.js:141:
WARNING - mx.resources.ResourceManager.getInstance defined before
its owner. mx.resources.ResourceManager is defined at
D:/dev/royale-emulation-works/github/royale-testing/src/main/mtest/bin/js-debug/mx/resources/ResourceManager.js:19
main.mtest.FindBug.ERROR =
mx.resources.ResourceManager.getInstance().getString('messages',
'error');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And the exception :
FindBug.js:141 Uncaught TypeError: Cannot read property
'ResourceManager' of undefined
at FindBug.js:141
(anonymous) @ FindBug.js:141
SystemManager.js:231 Uncaught TypeError: Cannot read property
'mixins' of undefined
at
FindBug_mx_managers_SystemManager.mx.managers.SystemManager.start
(SystemManager.js:231)
at index.html:366
The source piece :
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C214a28cd7e0f4509fcb008d75f12800e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637082405385556255&sdata=cEe899smXmBBvfHTT4F%2FzTh9NYoMxf8y3JwYxHS1jAU%3D&reserved=0>
xmlns:s="library://ns.apache.org/royale/spark"
xmlns:mx="library://ns.apache.org/royale/mx"
paddingBottom="0" paddingTop="0" paddingLeft="0"
paddingRight="0"
height="100%" width="100%"
creationComplete="onCreationComplete()"
xmlns:comps="com.likya.pinara.comps.*"
>
<fx:Metadata>
[ResourceBundle("messages")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import mx.resources.ResourceManager;
public static const ERROR:String =
ResourceManager.getInstance().getString('messages', 'error');
public function onCreationComplete():void {
}
protected function
button_clickHandler(event:MouseEvent):void {
}
]]>
</fx:Script>
<fx:Declarations>
</fx:Declarations>
<s:layout>
<s:VerticalLayout gap="10" paddingRight="10"
paddingLeft="10" paddingTop="10" paddingBottom="20" />
</s:layout>
<s:Button id="button" width="200" label="Show/Hide"
click="button_clickHandler(event)"/>
<mx:Panel title="Form Container Example"
paddingBottom="10" paddingTop="10" paddingLeft="10"
paddingRight="10"
height="100%" width="100%">
<mx:Text width="100%"
text="Moving from one form field to another
triggers the validator."/>
<mx:Form width="100%" height="100%" >
<mx:FormHeading label="Enter values into the form."/>
<mx:FormItem label="First name" >
<mx:TextInput id="fname" width="200"/>
</mx:FormItem>
<mx:FormItem
label="{resourceManager.getString('messages', 'userName')}">
<mx:TextInput id="username" width="200"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
</s:Application>
Thanks,
Serkan