2 Replies Latest reply on Nov 26, 2007 4:13 PM by mike_morearty

    Components/Namespace issue

    mcvenice1
      I am following along a simple tutorial in "The Essential Guide to Flex 2 with Actionscript 3" where i create a component, create a folder for my components in the Flex Project and then add the namespace to the main application file. When back in the main file, I am unable to call my component. No matter what i do or where I put it the main app will not recognize it. When creating the component, I notice Flex 3 mandates puting it in the 'src' folder where my main app is. So I did that and still ...nada...this is driving me bonkers...I can't get to square 1 here...Does anyone else experience this madness? Any help wold be appreciated!
        • 1. Re: Components/Namespace issue
          Mike8086
          I'm reading the same book and ran into the same problem. I wonder if it's a beta bug? I was able to successfully perform the exercise in Flex 2.

          Here's the code:

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
          xmlns:comp="Components.*">
          <comp:Form_Components />
          </mx:Application>

          Then in the Components folder, you're supposed to be able to put a Flex Component file with source code in it. According to the book, when you start typing <comp: ... it's supposed to list out the component but that doesn't happen in Flex 3 as it does in Flex 2.

          I hope someone can shed some light on this. :)
          • 2. Re: Components/Namespace issue
            mike_morearty Level 1
            I just tried this myself, and it worked for me. Here's what I did:

            1. Create new project "MyProj"
            2. In the Flex Navigator view, click on the "src" folder
            3. File > New, Folder, to create a folder named "comp"
            4. Click on the "comp" folder
            5. File > New, MXML Component; name it "Form_Components". That creates a file called MyProj\src\comp\Form_Components.mxml
            6. Open MyProj.mxml
            7. Inside the body of the document, type "<comp:Form_" and then Enter, or "<Form_" and then Enter.