There is one form throughout my flex application, which contains a bunch of inputs and combos. Of course, I want to write it in a reusable fashion. so I wrote XyzWindowUtil.as and XyzWindow.mxml in a package called net.xyz.widgets. My app mxml is located at the src folder. When I try to use it in mx:Application by writing <ns2:XyzWindow/>, it says "Could not resolve <ns2:XyzWindow> to a component implementation. " ns2 is the namespace xmlns:ns2="net.xyz.widgets.*".
Did I do anything wrong? I could make it work by dragging them to the src folder. However, I just don't think it's a good idea to organize things. Any comment or help would be appreciated!!
I could make it work by dragging them to the src folder.
That's exactly what you need to do. After all, they're source files
When you define "src" as the source directory, that's where the compiler will look for classes/packages.
So the package net.xyz.widgets.* resolves to src/net/xyz/widgets/
Right-click on Project --> Properties --> Flex Build Path --> Source Path(Here add folder which you have dragged to src folder) Save the changes, keep xmlns:ns1 as it is.
This may lead to change some package paths.
Right-click on Project --> Properties --> Flex Build Path --> Source Path(Here add folder which you have dragged to src folder)
There is no need for that. "src" is already in the Build Path (the default) as he described.