flash actionscript:
[quoted text, click to view] "agorman" <webforumsuser@macromedia.com> wrote in message
news:e2163h$4na$1@forums.macromedia.com...
>I am developing a form-based application. There is one root form called
> "Application" and a few child forms off the root (e.g., Login, CustView).
> I
> would like the sibling forms to be able to pass contol to each other
> (e.g.,
> after successful login, I want to make Login invisible and CustView
> visible).
>
> I wanted the root form to control this interaction, but I'm not sure how
> events in child can be handled in the parent. This is a common technique,
> but
> in this case, the parent doesn't explicitly instantiate the child, so I
> can't
> just pass a reference to the parent to the child's constructor. I can use
> this.parentForm to get a reference to the parent form, but I can't seem to
> find
> the parent's methods, just it's gui elements (i.e.,
> this.parentForm.parentMethod() doesn't work).
>
> Can some tell me how to do this? I am considering a FormManager class,
> which
> is a singleton class that each form can registers with and can use to
> toggle
> the visibility of itself and its siblings, but I wanted to see if there
> was an
> easier way to access methods on the class instance associated a parent's
> form.
>
> Any suggestions?
>
Why don't you explicitly instantiate the children with a reference to the
parent form. That way you could store the reference in the constructor. As
long at the functions are public I think it should work.
Amy