you need to declare the namespace in the application tag for your components, add this to the tag:
xmlns:mycomp="myComponents.*"
then in your main application, use this:
<mycomp:artart />
<mycomp:Colornail />
hth,
Jeremy.
Scoping problem?
In my project directory (mainApp) I made a subdirectory myComponents (mainApp/myComponents)
In this subdir I put my mxml component artart.mxml
In artart.mxml I create a TileList with a itemRenderer as follow:
<mx:TileList x="36" y="20" width="160" height="280" id="tlstColors" dataProvider="{mx.core.Application.application.dataColors}"
itemRenderer="Colornail" borderStyle="none" allowMultipleSelection="true" columnWidth="35" rowHeight="60"
selectedIndex="0"/>
the Colornail component (Colornail.mxml) is a component based on VBox.:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="50" height="60"
horizontalAlign="center"
verticalGap="4" borderStyle="none">
<mx:Image id="imgColor" width="30" height="30" source="{data.image}" toolTip="{data.naam}"/>
<mx:Label text="{int(data.id_color)}" width="30" fontFamily="Verdana" fontSize="8"/>
</mx:VBox>
รจ When I put Colornail.mxml in subdir myComponents I get a compiler error "1172:Definition Colornail could not be found"
But if I put Colornail.mxml in the mainApp directory the compiler can find the component.
I want all my component in the myComponents subdir, can anybody explain me what I have to do to let the compiler find the component.
Leo Wieland
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- [flexcoders] itemRenderer question, scoping? Leo Wieland
- Re: [flexcoders] itemRenderer question, scoping? Jeremy Lu
Reply via email to

