If you used add child, would that not make your component
look strange?
No, we are talking about a TilePanel. With an updated public API.
AKA
public function addTile(child:DisplayObject):DisplayObject
{
return tile.addChild(child);
}
I am not advocating this technique but, it does work.
She wanted an enhanced Panel. That is why this conversation started. She
didn't need a light container.
Peace, Mike
On 4/27/07, Paul J DeCoursey <[EMAIL PROTECTED]> wrote:
Michael Schmalle wrote:
>> My experience has been with creating containers from DisplayObjects
>
> Ok, how do you use your DisplayObjects in mxml containers (IE mxml)? You
> haven't implemented IFlexDisplayObject.
I'm sorry, I meant UIComponent <#UIComponent%28%29>, not DisplayObject,
I was working in Flash today and got my terms mixed up.
>
> I'm completely lost on your second paragraph.
Essentially it was describing how to create a clean container with only
two layers, and not all the extras that aren't necessary for a simple
container.
>
>> It doesn't make sense why you wouldn't just add the container to the
>> Panel
> and then after that
> point add items to the container.
>
> I suggested this in my first response to this question.
>
> My sugesstion was, create the composite container BEFORE
> super.createChildren(), override createComponentsFromDescriptors(),
> remove
> the children that get created with createChild(). Then create public
> methods
> like addCompositeChild() removeCompositeChild() for adding and removing
> children from the composite container.
sure.
>
> If you try and override addChild(), you mess up overalys, measuring etc.
I also override measure.
>
> PS An example would be making a TilePanel. If you are truly going after
> abstractness, you want the Panel to do what is meant to do without
> having a
> user add a Tile to the Panel in mxml. With the process above, you have
> successfully created a tile panel with the ability to add and remove
> tiles.
>
what if they are added after creation is complete? how do they get
added to the inner component? Unless I am missing something you will
need to know to call the addCompositeChild function rather than
addChild. If you used add child, would that not make your component
look strange?
> Peace, Mike
>
>
>
--
Teoti Graphix
http://www.teotigraphix.com
Blog - Flex2Components
http://www.flex2components.com
You can find more by solving the problem then by 'asking the question'.