Have the panel with the button dispatch an event to which the parent (main) listens, The listener then takes care of things (like moving the panel).

Interfaces have nothing to do with this.

regards,
Muzak

----- Original Message ----- From: "Omar Fouad" <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, April 02, 2008 1:58 AM
Subject: Re: [Flashcoders] Interfaces


Well, the example in the blog explained it a lot, though it is in
Actionscript 2.0.

And yes, I wont need Interfaces unless I really feel like I HAVE to use
them.
In my project I have some Panels (screens) in the fla Library and each one
of them is linked to a Class (linkage). Each class or Panel extends an
abstract Class called APanel that extends MovieClip. The APanel Class
contains some features that I need to be shared to all the other Panels. In
the Main class, I managed how to switch them, based on the application flow
and navigation. I use some navigation buttons that slide them to the right
or to the left of the stage.
Till here everything worked fine. But at a certain point I found some
problematic issues. I also need the panels to slide when a certain button is
pressed in one of them. Of course the function I used in the Main Class to
slide the Panels away, wouldn't be available to the other classes unless I
set them to be static, so I could write:

Main.SlideLeft();

Fine. But to make the function static, I'd put in consideration some other
things like turning some of the Main Class Properties used in the function
to static. And that is a problem because library variables cannot be
declared static.

So I think that the use of an interface somewhere would solve the problem.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to