teotigraphix.blog.show()

Flex2 :: Child Composition

Hi,

Back to technology and Flex2 components. My articale today will focus on components and their children.

With the addition of of ActionScript 3, we have a very powerful relationship between parent and child. When programming AS2, you really were stuck on certain branches and used a lot of the processor creating new instances with createClassObject() or createObject().

This has all changed in AS3, we now have the ability to call a new component by using the new MyComponent() implementation. Also note, a child can switch parents if need be. When you think about it, this could save a lot of processing time.

I am not going into the details of how I implement this technique yet becasue I myself am still finding best practices for myself and don’t want to deceminate any information before my tests are solidified.

One thing to note, don’t get caught up in the actuall language of parent child anymore, it means something on a whole new level.

We must assume a container, subcontainer view when thinking about parent child relationships. What do I mean by this?

When using prior versions of the Flash Player we were limited to the ‘chain’ when the instance was created. So in essence, the parent-child meanings REALLY meant parent with it’s child. This ‘relationship’ is not so anymore. We have containers and sub containers. There is now no direct tie to eachother due to the fact we can reparent.

Reparenting; I really think this is the wrong word to use now. It will lead to confusion and incorrect implementations. I tink the word Recomposition would be better, is it a word? :-)

We are now playing with a full set of legos that need to be looked at as seperate entities alltogether and designed and developed as such.

Peace, Mike

PS, Another really good article comming up on this today with some example code.

Leave a Reply