The point is that creating 2 files in the same folder, with the same case-sensitive name, is ambiguous. When you import one of the files into a component, how do you suppose that the compiler would know which one to use? It doesn't matter if its a file or class or interface or whatever. The compiler can't read your mind; yet :) Your approach of abstracting the view script code out of the view is a good idea; especially for unit tests. Just use a different name and you'll be fine.
-TH --- In flexcoders@yahoogroups.com, "Brian J. Ackermann" <brian.ackerm...@...> wrote: > > So, its a class, even thought it doesn't declare a class inside the text? > > ------------------------------ > Brian J. Ackermann > brian.ackerm...@... > 952.373.1626 > ------------------------------ > > > > > > On Thu, Jul 1, 2010 at 10:21 PM, turbo_vb <timh...@...> wrote: > > > > > > > Glad that you were able to resolve the problem. The AS file IS a class, and > > if it lives in the same package as the mxml component, the compiler will > > balk; because it doesn't know which one to import elsewhere. Adobe best > > practice would have you use Uppercase for the first letter of all classes. > > Renaming the script class to something like FooScript.as or FooModel.as > > might be a better way to go. > > > > Cheers, > > > > -TH > > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Brian > > J. Ackermann" <brian.ackermann@> wrote: > > > > > > Here's what the problem was. > > > > > > I had originally had a file called "Foo.mxml" which contained a lot of > > > ActionScript Code. I decided to create a new ActionScript FILE to contain > > > that script code. I named the file "Foo.as", to indicate the correlation > > > with the mxml file. > > > > > > Renaming this new as file to "foo.as" (lowercase f), resolves the issue. > > > > > > I'm not at all sure why this would have caused a conflict with the > > compiler, > > > since it wasn't a class....but at least I've resolved the issue. > > > > > > On Thu, Jul 1, 2010 at 7:57 AM, valdhor <valdhorlists@> wrote: > > > > > > > > > > > > > > > One other thing to check. Make sure you are not using a reserved name > > for > > > > your component. > > > > > > > > > > > > --- In flexcoders@yahoogroups.com > > > > <flexcoders%40yahoogroups.com><flexcoders% > > 40yahoogroups.com>, > > > > > > "turbo_vb" <TimHoff@> wrote: > > > > > > > > > > A couple things that you can check that might help: > > > > > > > > > > Make sure that you have an import statement for the component in > > the > > > > parent class. > > > > > If your component is an AS class, make sure that the package, at > > the > > > > top of the class, is correct. > > > > > If your component is an AS component make sure that the class name, > > > > within the component, is correct. If you are using a constructor check > > that > > > > too. > > > > > > > > > > -TH > > > > > > > > > > --- In flexcoders@yahoogroups.com > > > > > <flexcoders%40yahoogroups.com><flexcoders% > > 40yahoogroups.com>, "Brian > > > > > > J. Ackermann" <brian.ackermann@> wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > I'm a wee bit stuck on this, and was hoping you might have some > > input > > > > to > > > > > > help me. > > > > > > > > > > > > I'm getting the "Could not resolve * to a component > > implementation." > > > > error > > > > > > message. However, everything I've read about this via Google hasn't > > > > helped > > > > > > my case in the slightest. I presume I'm just missing something > > obvious, > > > > but > > > > > > maybe its something more serious. > > > > > > > > > > > > So, to solve this problem, I've tried two things, and both work, as > > far > > > > as > > > > > > they take me. First, I added a new component, of the exact same > > > > variety, > > > > > > and then copied the contents of the erroring component into it. I > > > > replace > > > > > > the viewstack 'page' with the new component (which as near as I can > > > > tell is > > > > > > IDENTICAL, but with a different name), and the compiler error goes > > > > away. > > > > > > > > > > > > I can also solve this by simply renaming the original component & > > > > letting > > > > > > FB4 refactor for me. The error goes away again. But if I then > > re-rename > > > > > > back to the original name, I get the compiler error again. > > > > > > > > > > > > I've tried to clean the project several times, and that doesn't > > help. > > > > > > > > > > > > I'd really like to understand what I've done wrong here. What am I > > > > missing? > > > > > > > > > > > > Thanks much! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >