You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/07/30 03:22:49 UTC

[GitHub] [royale-asjs] greg-dove commented on issue #438: Unable to port a flex method

greg-dove commented on issue #438: Unable to port a flex method
URL: https://github.com/apache/royale-asjs/issues/438#issuecomment-516244556
 
 
   Alex is correct  (this will let you loop through the public instance variable definitions). 
   But you will also need to make more changes inside the loop.
   (assuming 'val' is a VariableDefinition in all below):
   wherever you have name comparisons it should be without the '@'
   instead of:
   if((aFormItems[k].id == val.@name)
   it should be:
   if((aFormItems[k].id == val.name)
   
   And you need to change any reflection based getting and setting...
   
   instead of:
   aFormItems[k].text = aValuObject[val.@name];
   
   you need:
   aFormItems[k].text = val.getValue(aValuObject);
   
   Generally for getting or setting values it should be like:
   var instanceVal:* = val.getValue(instance); 
   val.setValue(instance, valueToBeSet)
   
   You should use the above approach instead of using instance[val.name]. (where val.name is the name of the variable in the original actionscript, and is the same value as for name in XML attribute)
   
   The getValue/setValue approaches are important if you want to use reflection for manipulating public vars correctly in js-release build (because they are likely to be renamed by google closure compiler)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services