Difference between initialize and creationComplete in the mx:application tag

1,946 views
Skip to first unread message

gaurav arora

unread,
Feb 27, 2008, 6:05:54 AM2/27/08
to flex_...@googlegroups.com
Hello all,
 
Can anyone tell me the difference between initialize and creationComplete in the mx:application tag.....as in which gets called earlier and what are the best practices inolved with both these properties?
 
thanks in advance,
gaurav

Amol Pandhare

unread,
Feb 27, 2008, 9:47:14 AM2/27/08
to flex_...@googlegroups.com
Hi,

Initialize is the very first event fired in the component life cycle. As good as a constructor of a class.
In this event you get no values pertaining to the component like the actual height, width, etc.

CreationComplete is the event which gets fired at the fag end of the component life cycle after the whole component is completely created along with its childrens if any. In this event you will get values pertaining to the component like the actual height, width, etc as the component is already created here.

Note: Any particular tag on the MXML file is nothing but a component.

Hope this helps you and suffices your need.

Regards,
Amol.

Rahul Sood

unread,
Feb 27, 2008, 11:00:47 AM2/27/08
to flex_...@googlegroups.com
Thanks Amol for a nice explanation n Gaurav for a good question.
 
happy flexing
Rahul.

--
"Learning is not necessary, neither is survival"

PradeepKumarD

unread,
Feb 27, 2008, 4:43:18 PM2/27/08
to Flex India Community
Hi Gaurav,

Check out the below link, I hope, It'll give some more explanation of
life cycle for ur Q.

http://www.onflex.org/ted/2007/02/flex-instantiation-life-cycle-and-event.php


PradeepKumar, D.
Software Developer.
Reply all
Reply to author
Forward
0 new messages