Search code examples
flashapache-flexcompiler-errorsadobexml-namespaces

Could not resolve <local:chatters> to a component implementation


My flex source folder 'src' has these files:

src/
  chatters.as
  chatters.mxml
  main.as
  main.mxml

This is the source of 'chatters.mxml':

<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"  
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" 
         width="250" height="200"
         contentBackgroundColor="#abcdef">
</s:Group>

This is the source of 'main.mxml':

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       xmlns:local="*"
                       applicationComplete="run();">    
    <local:chatters>        
    </local:chatters>
</s:WindowedApplication>

All the files chatters.as, chatters.mxml, main.as, main.mxml are under default package, and the XML namespace for default package is set as xmlns:local="*" in main.mxml.

However, I get the error message: Could not resolve <local:chatters> to a component implementation when creating 'chatters' component in main.mxml.

Everything is in default package, xmlns already defined, how come flash builder shows me such error message?


Solution

  • Perhaps it's getting confused about which class to use. Your src/ directory seems to have a chatters.as and chatters.mxml. Each one of these is defining a class named chatters.

    I just tried to create an Actionscript class with the same name of an MXML document, but Flash Builder would not let me. Hoping there's an interesting story about how you did that :)

    Flash builder gets confused when 2 files .as and .mxml with the same name in the same folder.