2

I've got a custom CalloutButton component in a package called uiComponents. This custom CallOutButton is needed because I need some more properties in it.

This CalloutButton gets added to my MXML like usual;

     <uiComponents:MyCustomCalloutButton someproperties here >

     </uiComponents:My...>

Now, the enclosed s:calloutContent gets a compilation error, the (almost standard) could not resolve...

Naturally, the namespace has been imported

What am I missing here? This is driving me nuts for more than an hour now. Any help would be greatly appreciated!

Cheers!

AlBirdie
  • 2,071
  • 1
  • 25
  • 45
  • What is the compilation error? Is this just a matter of you not importing the 'uiComponents' namespace at the top of your MXML file? – JeffryHouser Jan 24 '12 at 17:08
  • uiComponents has been imported (I already tried different namespaces, class names and packages in case that there is a flex internal class with a similar name). Oddly enough, the error doesn't occur at the MyCustomCallout line, rather than on the enclosed s:calloutContent tag. Instead of simply extending the CalloutButton class, I already copied the whole content of it to my CustomCallout, so I reckon there's an issue with encapsulated spark components in a component with a different namespace (although that works fine for components other than the Callout). – AlBirdie Jan 25 '12 at 07:30
  • 1
    Show us the code where you inport the uiComponents namespace. If the error occurs on an enclosed callout tag; why didn't you show us that line? In many situations, enclosed tags must use the same namespace as their parent, so replace it with "uiComponents:calloutContent" – JeffryHouser Jan 25 '12 at 13:47
  • I did not know that. Worked perfectly fine. Thank you very much! Appreciate it! – AlBirdie Jan 25 '12 at 15:26
  • I posted that as a formal answer for you. – JeffryHouser Jan 25 '12 at 16:05

1 Answers1

2

Since the error was generated from the s:calloutContent tag ; not the uiComponents:MyCustomCallOutButton tag; the solution was that in many situations, enclosed tags must use the same namespace as their parent, so replace it with uiComponents:calloutContent

So instead of this:

 <uiComponents:MyCustomCalloutButton someproperties here >
     <s:calloutContent />
 </uiComponents:My...>

You'll need to do this:

 <uiComponents:MyCustomCalloutButton someproperties here >
     <uiComponents:calloutContent />
 </uiComponents:My...>
JeffryHouser
  • 39,401
  • 4
  • 38
  • 59