5 Replies Latest reply on Sep 12, 2007 12:25 PM by mike_morearty

    Flex debugging issue

    Roustalski
      See the 4th comment by mike, located here:
      http://www.morearty.com/blog/2006/06/28/flex-2-has-launched-whats-new-in-the-debugger-sinc e-beta-3/

      quote:

      “The debugger doesn’t stop at breakpoints when using <script src=”XXX”> to point to files located in subfolders - The workaround is to temporarily move your scripts out of the subfolder or to put them inline in a Script block in the MXML file.”

      Has this been addressed? Is there a better workaround? Why can I debug into components in one project but not another? All of the project settings are the same.

      Ideas?
        • 1. Re: Flex debugging issue
          mike_morearty Level 1
          Yes, that particular issue has been addressed. The bug existed in Flex Builder 2.0, but was fixed in Flex Builder 2.0.1.

          Not sure why you would be able to debug into components in one project but not another. What is failing? Does it launch, but fail to hit breakpoints you have set? Do the breakpoints show up at all (with the blue circle)? After the app is running, does a checkmark show up on top of the blue circle like it should?

          I would also be interested in seeing the contents of the .actionScriptProperties file and the .project file. (The .flexProperties file isn't particularly relevant to this issue.) And I'd be interested to know the directory hierarchy of the project: what directory is the .mxml file in that has the <script> tag? What is the exact contents of the <script> tag?

          Maybe we can track this down...
          • 2. Re: Flex debugging issue
            Roustalski Level 1
            The application would launch and I could stop at breakpoints set in the application (root level), but any breakpoint set in any sub-tree would not be hit.

            The issue was a naming conflict. I had a sub-folder with the same name as one of the components and it couldn't resolve "componentName.componentName". I simply changed the name (e.g. "componentName.newComponentName") and all was fine.

            Maybe there should be some sort of validation in the next release to prevent me from doing that [:
            Thanks for the quick response and hopefully this will help someone else who is unfortunate enough to name directories and files with the same names. (I'm used to the extensions being the differentiating factor).
            • 3. Re: Flex debugging issue
              mike_morearty Level 1
              I'm trying to figure out what you mean. I tried this -- a directory MyComp with a file MyComp.mxml inside it:

              MyProject
              MyApp.mxml
              MyComp/
              MyComp.mxml

              In MyApp.mxml, I created an instance of MyComp:
              <ns1:MyComp />

              That worked fine.

              I also tried this -- a file MyComp.mxml in the top-level dir, and a subdir MyComp in that same top-level dir:

              MyProject
              MyApp.mxml
              MyComp.mxml
              MyComp/

              That also worked fine.
              • 4. Re: Flex debugging issue
                Roustalski Level 1
                I can send a zipped project demonstrating the problem if you wish, but here are the steps to reproduce the problem:

                1. Create a new flex basic project (fb2.0.1) named DebugProblem
                2. Create a new folder named MyComponent
                3. Create a new folder named MyOtherComponentLib
                4. Create a component mxml in the new MyComponent folder called MyComponent.mxml
                5. Create an actionscript file in the new MyComponent folder called MyComponent_cb.as
                6. Create an actionscript class in the new MyOtherComponentLib folder called MyOtherComponentLib.as
                7. Create an actionscript file in the root (DebugProblem) called DebugProblem_cb.as

                DebugProblem.mxml:
                quote:

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" xmlns:mc="MyComponent.*">
                <mx:Script source="DebugProblem_cb.as"/>
                <mc:MyComponent id="hohoho"/>
                </mx:Application>

                DebugProblem_cb.as:
                quote:

                // ActionScript file
                public function init():void {
                trace("I can debug here...");
                }

                MyComponent.mxml:
                quote:

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="400" height="300" xmlns:mocl="MyOtherComponentLib.*" creationComplete="init()">
                <mx:Script source="MyComponent_cb.as"/>
                <mocl:MyOtherComponentLib id="lol"/>
                </mx:Canvas>

                MyComponent_cb.as:
                quote:

                // ActionScript file
                public function init():void {
                trace("I can not debug here... despite having a break point");
                }

                MyOtherComponentLib class:
                quote:

                package MyOtherComponentLib
                {
                public class MyOtherComponentLib
                {
                private var _HelloWorld:String;

                public function MyOtherComponentLib() {
                _HelloWorld = "Hello";
                trace(_HelloWorld);
                }

                public function set helloWorld(value:String):void {
                _HelloWorld = value;
                trace(_HelloWorld);
                }
                }
                }


                Finally, place a breakpoint on the trace statement in DebugProblem_cb.as and a breakpoint on the trace statement in MyComponent_cb.as, and then debug the application.

                Hope this helps.
                • 5. Re: Flex debugging issue
                  mike_morearty Level 1
                  Thank you very much for the detailed repro steps -- this helps a ton. I can tell you that this is a known bug in the compiler (in the part that generates information that is passed on to the debugger), and it has already been fixed.