After reading the documentation again i actually think thats the best place to add shizzle to children.
"Then it dispatches an
initialize event, giving developers a chance to affect the component after its internal structure has been created." however, a few lines down they say "If you are writing a component, you should not need to override this method."
After some thinking this might not be the best place to call things on children. Adding event handlers should be ok, allthough they can also be set in the createChildren override, the event related stuff is present directly after instantiation. The child component itself may however not be ready at that time.
The child component is only ready as soon as it dispatches the creationComplete event. Im not sure what the best time (method) is to add shizzle to children.
After reading some more documentation i found this in the createChildren override:
if (!text_mc) {
text_mc = new TextArea();
text_mc.explicitWidth = 80;
text_mc.editable = false;
text_mc.addEventListener("change", handleChangeEvent);
// Add the child component to the custom component.
addChild(text_mc);
}
text_mc = new TextArea();
text_mc.explicitWidth = 80;
text_mc.editable = false;
text_mc.addEventListener("change", handleChangeEvent);
// Add the child component to the custom component.
addChild(text_mc);
}
Which means that you add listeners and set properties here in the createChildren override.
Greetz Erik
On 9/21/06, Sergey Kovalyov <[EMAIL PROTECTED]> wrote:
But I use initialize() override now. Actually this method implementation contains createChildren() call:public override function initialize() : void {super.initialize();myChild.addEventListener(Event.CHANGE, onMyChildChange);}Is it correct?
On 9/20/06, EECOLOR < [EMAIL PROTECTED]> wrote:Hello,there are a few valid places, check the documentation on these events to see whats most suitable for your needs:- Event handler for creationComplete- Event handler for initialize- In some cases in the createChildren override after the super.createChildren callGreetz Erik
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Software development tool | Software development | Software development services |
| Home design software | Software development company |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___

