Hi Andrew,
first of all if you are using ArrayCollection and not ArrayList you must
configure that. In my code I'm using this to configure ArrayList as the
type royale must use when send and receive java ArrayCollection:
registerClassAlias("flex.messaging.io.ArrayCollection", ArrayList);
(don't remember if Greg made it default to ArrayCollection)
about serialization/deserialization issues, maybe other could give you
better clues than me, since all our objects are strongly typed so objects
in collections are classes and if that classes has collections then the sub
objects will be typed as well.
I found that when I have problems when something runs in debug mode but not
in release mode for deserialization issues the object bracket access use to
work always, so I think is what you need to do, so for example in you case
I think this should work:
results[I]["outputArray"]["source"][0][RESULT_CODE]
HTH
Carlos
El lun., 22 jul. 2019 a las 11:17, Frost, Andrew (<[email protected]>)
escribió:
> Hi again
>
> One extra question here: we have the AMF connection working fine now in
> Debug mode, but in Release mode the minifier is changing the property names
> of our JavaScript (compiled from ActionScript), but these are not being
> reflected in the objects that are deserialised.
>
> So for example, we are receiving an ArrayCollection, and accessing one
> element's property directly e.g.:
> var results : ArrayCollection = resultEvt.result as ArrayCollection;
> for (var i : uint = 0; i < results.length; i++)
> {
> var resultCode : String = results[i].outputArray.source[0].RESULT_CODE;
> ...
>
> There are a couple of things going on:
> (a) each element in the main ArrayCollection has an "outputArray" property
> which is itself an ArrayCollection. We could cast it into an
> ArrayCollection variable I guess, but instead have just added "source" so
> that the JavaScript doesn't try adding the [] operator to the
> ArrayCollection object directly...
> (b) the contents of this ArrayCollection, in this particular case, is a
> simple object {RESULT_CODE: "OK"} - which I can see in the console when we
> add some trace. The js-debug file has the same structure as the
> ActionScript; but the js-release file has a mapping at the start
> "nc='RESULT_CODE'" and then accesses the data with "
> a.L(c).outputData.source[0].tP" (and that's even weirder as why is it 'tP'
> rather than 'nc'?!)
>
>
> I guess the questions I have are:
>
> 1) Is there a way to prevent the Google closure compiler from minifying a
> particular property name/string?
> or
> 2) Are we going to have to just declare classes for all of these and do a
> typecast e.g. along the lines of:
> class ResultCode { [Bindable]public var RESULT_CODE; }
> and then
> var resultCodeObj : ResultCode = results[i].outputArray.source[0];
> var resultCode : String = resultCodeObj.RESULT_CODE;
>
>
> thanks
>
> Andrew
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>
>
>