Hi all,

I create a TitleWindow with the PopupManager. The titlewindow should
dynamically contain a canvas.
So how did I do that. I gave the titlewindow a property called
'contentForm' which contains a canvas. Then in the
creationComplete-event of the titlewindow, addChild(contentForm) is
called for adding the canvas to the titlewindow.
So far, so good...

Next I wanted to create some popup/popout effect on the titlewindow.
So I set creationCompleteEffect to 'popup', a mx:Parallel of
zoom/move/fade. I also set the removedEffect to 'popout', a mx:Sequence.

What's the problem? The 'popup'-effect should move the titlewindow
from the top to the center of the application. I figured this move-tag
would give me what needed:
        <mx:Move
                yFrom="{-this.height}" yTo="{(Application.application.height -
this.height) / 2}"
                xFrom="{Application.application.width / 2}"
xTo="{(Application.application.width - this.width) / 2}"
        />
However, this isn't working as expected.
The only logical explanation I can come up with is the following:
creationComplete and creationCompleteEffect both get executed when the
creationcomplete-Event is fired. Since the childComponent is only
added during the handling of that event, the effect playing is not yet
aware of the change in size.

This lead me into the FlexDocs, where I learned that adding children
should be part of the initialisationEvent.
So I assigned my init()method to the initialize-listener instead of
creationComplete.
However, this is giving me the following errors:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
        at mx.containers::Panel/::showTitleBar()
        at mx.containers::Panel/mx.containers:Panel::layoutChrome()
        at mx.core::Container/mx.core:Container::updateDisplayList()
        ...
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
        at components::PopupFormWindow/::init()
        at components::PopupFormWindow/___TitleWindow1_initialize()
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        ...

My init-method is as follows:
private function init():void {
        //create inner form
        contentForm.currentState = this.currentState;
        (contentForm as customerPopupForm).ac = this.ac;
        this.addChild(contentForm);
}

Any help, push in the right direction is really appreciated. I will
provide the full errormsgs/more code if needed, but I consider this to
be a long post already ;)
--Johan


Reply via email to