That's not really how Decorator is meant to work. You could hack around it by exposing the decorated instance in your Decorator interface, digging down to it, and using a bunch of instanceof calls to figure out which is which. I really don't recommend this, though -- instead, use a different design pattern or program architecture.
On 3/20/08, Jiri Heitlager <[EMAIL PROTECTED]> wrote: > Hello List, > > i am looking into the decorator pattern for an upcoming AS2 project. I was > wondering if the following is possible > > var com:Component = new Component() > > com = new decoratorA(com) > com = new decoratorB(decA) > com = new decoratorC(decB) > > I cant seem to figure out what I need to do in order to remove let say > decB at runtime? I tried a search on the internet, but all the articles > about the decorator pattern are about runtime adding, not removing. > > Can somebody please help me if it is at all possible. > > Thank you, > > Jiri > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Cory Petosky : Lead Developer : PUNY 1618 Central Ave NE Suite 130 Minneapolis, MN 55413 Office: 612.216.3924 Mobile: 240.422.9652 Fax: 612.605.9216 http://www.punyentertainment.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders