7 Replies Latest reply on Sep 10, 2008 6:09 PM by jag57

    What am I missing?

    jeremybixby
      Hi,

      I am new to flex, but I know java and javascript. I am trying to move some comboBox mxml components into a separate file. I made the necessary comboBoxes in separate files, and then when I specify a reference to a comboBox, I get no prompt telling me to autocomplete. It further tells me that Flex:

      "Could not resolve <components:cboFile> to a component implementation."

      What is going on here? I of course reference the namespace with:

      xmlns:giscomponents = "GISComponents.*"

      Not sure what this is about. Probably something similar. I would appreciate any ideas...
        • 1. Re: What am I missing?
          jag57
          You declared the namespace to be "giscomponents," but from the error message it seems you are trying to refer to them using the namespace "components." Try changing the namespace to "components."
          • 2. Re: What am I missing?
            jeremybixby Level 1
            Thanks for responding. I changed the "Could not resolve" message to be more generic and I forgot to change the code that I posted in the message.
            • 3. Re: What am I missing?
              jag57 Level 1
              Could you provide some context to your code? It would be helpful to see where you are trying to use your component.
              • 4. Re: What am I missing?
                jeremybixby Level 1
                I make a new mxml component based on a comboBox, and I put all the code for that in a seperate file called "GISComponents" in a different folder. Here is the code for that:

                <?xml version="1.0" encoding="utf-8"?>
                <mx:ComboBox xmlns:mx=" http://www.adobe.com/2006/mxml">
                <mx:dataProvider>
                <mx:String> Item1 </mx:String>
                <mx:String> Item2 </mx:String>
                <mx:String> Item3 </mx:String>
                </mx:dataProvider>
                </mx:ComboBox>

                Then when I want to reference the namespace in my main mxml file, I use this line of code in my application tag:

                xmlns:giscomponents = "GISComponents.*"

                Then I should be able to insert one of the comboBoxes anywhere in the markup by writing:

                <giscomponents:comboBox1></giscomponents:comboBox1>

                But the prompt doesn't register it. I get the error message that I noted before. I appreciate any ideas...
                • 5. Re: What am I missing?
                  jag57 Level 1
                  Am I right in my understanding that you named your ComboBox class file as GISComponents.mxml, and that you put this file in a folder named GISComponents?

                  If this is true, it would mean that you need to reference your ComboBox as <giscomponents:GISComponents/>
                  • 6. Re: What am I missing?
                    jeremybixby Level 1
                    No, the comboBox is named something like comboBox1.mxml. I just put all of my comboBoxes in a folder in my project called "GISComponents." Then I referenced them in the application tag with this:

                    xmlns:giscomponents = "GISComponents.*"

                    which imports the mxml namespace. So, I should be able to insert a custom comboBox object when I write:

                    <giscomponents: comboBox1></giscomponents: comboBox1>

                    but this isn't working. I did the VERY same thing in another test project yesterday, and everything worked fine. I did exactly what I did yesterday, but I can't figure it out.
                    • 7. Re: What am I missing?
                      jag57 Level 1
                      If you didn't change the main source folder when you created the project, your directory structure should be like this:

                      project/GISComponents/comboBox1.mxml
                      project/ProjectApplicationFile.mxml

                      In ProjectApplicationFile.mxml should be the namespace declaration: xmlns:GISComponents="GISComponents.*"

                      Then, you can refer to comboBox1 as <GISComponents:comboBox1/>

                      If this does not work for you, then I would suggest creating a new project and porting over your code and try building again.