6 Replies Latest reply on Apr 3, 2007 4:53 PM by BillHeit2

    Modify SDK Source Files

      I am trying to edit the SDK Source Files in Flex to fix some bugs in the DataGrid. I found the source code files in the Program Files directory at: C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\source\mx. I am able to open these files in Flex and edit the code. However, when I compile my application and try to step through the code, it appears that the SDK files do not get compiled.

      How do I compile the Flex SDK files after changing them.

        • 1. Re: Modify SDK Source Files
          Basically I think you can't do it. They are there only for reference I think. You can find those files also in {FLEX_INSTALL_DIR}/flex_sdk_2/frameworks/source/.
          If you want fix some bugs just create your own class which extends class you want to fix and just override original methods, out your code with fixes.
          Should be working.
          • 2. Re: Modify SDK Source Files
            peterent Level 2
            Here's what you do:

            Make a copy of the source file in your own project directory BUT use the EXACT SAME path. For example, mx.controls.DataGrid should go into the directory mx/controls in your project. This way the compiler will pick up your changed files over the ones in the SDK. In other words, don't change the code in the framework source directory, copy it and modify the copy.

            You can also do this with your own SWC (Flex Library) and then whenever you want to use your code over ours, just place your SWC above ours in the Library Path of whatever Flex Application project you are using.

            Caveat: we don't support your changes - you are responsible for them.

            Also: PLEASE fill out a bug report when you find something: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

            • 3. Modify SDK Source Files
              BillHeit2 Level 1
              Thanks. I tried it with the DataGrid.as file and it worked.

              However, the first time I compiled, I got an error on this line:

              include "../core/Version.as";

              So I added this class to my project and that did it.

              After that success, I tried copying the entire mx folder and it would not compile. There were about 32 errors. Some were errors like not implementing an inferface correctly. Others errors had to do with overriding a method that did not exist in the super class.

              Why would the source code not compile?
              And are there updated SDK files?
              How do I include the "../core/Version.as" file from the SDK?

              Thanks again for your help and I will log the bugs that I find.

              • 4. Re: Modify SDK Source Files
                peterent Level 2
                We didn't intend for anyone to take the entire source tree and compile it. So I'm not surprised there were lots of errors and missing pieces. I don't have the source right in front of me, but I suspect that the Version.as file is located in the core directory. If not, create your own. If there is one, modify it to change the version so that a query of the version on a component will yield a value different from our framework classes.

                You are just going to have to take it on a case-by-case basis.

                Keep in mind a couple things however. Anything marked mx_internal is totally subject to change. You might go through this exercise of fixing bugs and we'll come up with a new SDK and you'll find your changes are incompatable.

                You should really, really try to extend the classes and place your fixes into the extended classes. Sometimes however, we've made a function that's private when it would be best made protected. In a case like that, copy our source, then in your copy make the function protected, then extend that class and override that function and incorporate your change there.

                While that won't make it 100% forward compatible, it will keep the changes to a minimum.
                • 5. Re: Modify SDK Source Files
                  BillHeit2 Level 1
                  Thanks, that is good advice.
                  • 6. Modify SDK Source Files
                    BillHeit2 Level 1
                    FYI, I now realize I had grabbed the source code out of the backup folder in the SDK directory. I think this folder contains the old Flex 2.0 source code. So it would make sense that 2.0 and 2.1 files would produce interesting bugs.