On 5/13/16, 7:16 AM, "jude" <flexcapaci...@gmail.com> wrote:
>Thanks. I'll look into it. I think what that's doing is working with an >existing instance and checking for changes to it. I think I have to parse >a >string into a new XML instance each time and then do a compare. Yes, that's correct. And I believe that tree comparison is an entire field of algorithm research [1] However, there is another approach to consider which is essentially writing an MXML compiler in ActionScript. Maybe you don't care about the changes, you just want to rewrite the data array that the compiler generated and have that data re-interpreted. This option is possible because the framework uses a data array and not actual code. So it might be possible to read the MXML, parse it into a tree, and just walk the tree instead of comparing it to the old tree. You would have to have some way to track and re-use event handlers in the old array though. I think you will also need some way to "give up" and say that the changes were too complex and you must reload the app. The compiler could also be taught to output extra information to help you track code. And also consider the opposite problem: modify live and write out the results. The POC works by having an Agent communicate with a plug-in in a running SWF. The Agent and/or plug-in could also popup UI to highlight components in the running app and let you tweak those values in a GUI. Then those changes could be written to the MXML. Lots of possibilities here. I'm glad to see that you are interested. I hope to see something like this in an IDE someday. -Alex [1] http://stackoverflow.com/questions/5894879/detect-differences-between-tree- structures