Any time you're going to create a Dictionary to keep track of things like
this, make sure to use weak references, by calling new Dictionary(true) or
your app is likely to leak memory like a sieve :)

And you might be able to get away with UIComponent.initialized, depending on
what it is you're actually trying to achieve.

-Josh

On Mon, Oct 27, 2008 at 9:22 PM, florian.salihovic <
[EMAIL PROTECTED]> wrote:

> One way to do so:
>
> private var dictionaty:Dictionary = new Dictionary();
> private var button:Button = new Button();
>
> protected function initializeComponent():void
> {
> this.button.addEventListener(FlexEvent.CREATION_COMPLETE,
> onCreationComplete);
> this.dictionary[this.button] = false;
> }
>
> function onCreationComplete(event:Event):void
> {
> if (event.target == this.button)
> {
> dictionary[this.button] = true;
> }
>
> Working this way you can allways test, wether the component-creation has
> been
> completed or not.
>
> Best regards from Germany
>
> --- In flexcoders@yahoogroups.com, "cwicky99" <[EMAIL PROTECTED]> wrote:
> >
> > I need to programmatically determine if a component has dispatched
> > FlexEvent.CREATION_COMPLETE so that I know it has finished being
> > created as well as all of it's children.
> >
> > I don't see a "creationCompleted" property, is there some other way to
> > tell?  I know I can listen for the event I am wondering if there is
> > some other way to tell that it had already happened.  So I can have
> > logic similar:
> >
> > if ( comp.creationCompleted )
> > {
> >    // do stuff to a child
> >    comp.fooView.fooButton.addEventListener(...);
> > }
> > else
> > {
> >     comp.addEventListener(FlexEvent.CREATION_COMPLETE, handleCreation);
> > }
> >
>
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/

Reply via email to