Ah, I found the problem. In the code below, I'm mistakingly using:
login.addEventListener("login_success",
new mx.utils.Delegate.create(this, showSuccessPanel));
Note the undesired "new" call when creating the delegate. Instead, it
should just be:
login.addEventListener("login_success",
mx.utils.Delegate.create(this, showSuccessPanel));
It works just fine now. I can't believe it was that simple.
Thanks for all the help!
Blake
-----Original Message-----
From: Tracy Spratt [mailto:[EMAIL PROTECTED]
Sent: Monday, March 21, 2005 6:12 PM
To: [email protected]
Subject: RE: [flexcoders] Proper login window handling?
I notice you are using selectedChild. It is possible that
login_ok_panel does not exist when you try to set the selectedChild.
ViewStack, by default uses deferred instantiation and does not create
the children until the first navigation. So if login_ok_panel has not
been instantiated, you cannot set selectedchild to it
Try selectedIndex instead.
Tracy
-----Original Message-----
From: Blake Kadatz [mailto:[EMAIL PROTECTED]
Sent: Monday, March 21, 2005 8:39 PM
To: [email protected]
Subject: RE: [flexcoders] Proper login window handling?
I did try using a mx.utils.Delegate object but that didn't seem to work
either. Basically, I used:
// create login window, etc...
login.addEventListener("login_success",
new mx.utils.Delegate.create(this, showSuccessPanel));
and...
function showSuccessPanel():Void
{
login.deletePopUp();
main_stack.selectedChild = login_ok_panel;
}
In my LoginWindow file, if the username/password matched, I used:
dispatchEvent({type: "login_success"});
Still didn't work, unless I'm missing something obvious on how delegates
work. In the Developing Rich Clients book, page 367, I didn't see where
the setUpContextMenu was defined so perhaps there's an object being
passed I'm not aware of.
Thanks,
Blake
Yahoo! Groups Links
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/