"I draw my Countrys as movieclips without classes. Then create a MovieClip with a Country class and put inside each movieClip (Composition). Inside Country class, I have access to the parent display object using the parent property and do something like an Adapter pattern."
Ever heard of KISS ? On 7/5/06, Marcos Neves <[EMAIL PROTECTED]> wrote:
AS3 is really mature now, what is excellent! But there´s no reason to didn´t support it. Let´s think from other point of view. Each sprite on the flash screen, is an instance of some class. Flash ide is locking together View+Behavior, so I can´t have two differents Views with the same behavior. With Jcarlos tip, I found two ways to workaround this. But it´s didn´t seens right to me. I draw my Countrys as movieclips without classes. Then create a MovieClip with a Country class and put inside each movieClip (Composition). Inside Country class, I have access to the parent display object using the parent property and do something like an Adapter pattern. The other solution would be put all my countrys inside a MovieClip called World, and use a World class to access each country and assign the behavior. I´ll will upload my .fla files so you can understand. On 7/5/06, Adrian Park <[EMAIL PROTECTED]> wrote: > I'm not sure this is really a 'feature' that is missing since the problem > really boils down to OOP theory. For example, it could be argued that it is > incorrect for the country class to extend MovieClip since a country *is not* > a MovieClip but, rather, *uses* a MovieClip for display. By this rational, > it makes more sense to extend via composition - i.e. the country class > simply gets a reference to a MovieClip that represents it's visual > manifestation. This way, the same class is used for many MovieClips. > > If it was possible in AS2 and is no longer possible in AS3, I'd hope there > is a very good reason why and I'd hope that the reason has something to do > with AS becoming a more mature language and doing things in a better way. > > Am I wrong? > > A. > > On 7/5/06, Marcos Neves <[EMAIL PROTECTED]> wrote: > > > > You got the point. But this silly task wasn´t needed on flash 8. > > That´s the point. > > Should it be on flash 9? I don´t think so. > > Isn´t this the time to ask Adobe to include this feature? But I need > > help from others developers to show that this feature is essential. > > > > On 7/5/06, Meinte van't Kruis <[EMAIL PROTECTED]> wrote: > > > I'm not sure if it's entirely impossible to assign one class to multiple > > > movieclips, but if that's true than the easiest way to overcome that > > problem > > > is make a baseclass 'Country' and have Brazil extends Country. > > > > > > You still have the silly task of assigning all your countries to a > > > different class, but at least your code will be easy to manage. > > > > > > good luck > > > -Meinte > > > > > > On 7/4/06, Marcos Neves <[EMAIL PROTECTED]> wrote: > > > > > > > > Is this the place to talk about AS3? If not, where would be? > > > > > > > > The concept of any movieClip be a class is very powerfull, given the > > > > ability to do new ClassName to create a copy of any clip. But the Auto > > > > Generated class and the fact that you can´t have two movieclips with > > > > the same class is something that is limiting flash capabilities. > > > > > > > > Example: > > > > I have a A world map where each country is a movieclip. And every one > > > > will have the same behavior. Before flash 9, what I did is assign a > > > > class called Country to each movie clip. This way, I can easy update > > > > the behavior of all at the same time. > > > > > > > > With Flash 9, I can´t assign a class with the same name and can´t > > > > specify a base class to the Auto Generated extends. > > > > My suggestion is to do something like this: > > > > http://neves.bs2.com.br/flex/preview.jpg > > > > > > > > When ask for AutoGenerate, a check box would enable an different base > > > > class, and I would write on the textbox. So a movieClip called Brazil, > > > > would have a autoGenerated class called Brazil that extends the class > > > > Country, witch would be my base class. > > > > > > > > I´m shure no one can deny that this feature is essential. > > > > _______________________________________________ > > > > Flashcoders@chattyfig.figleaf.com > > > > To change your subscription options or search the archive: > > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > > Brought to you by Fig Leaf Software > > > > Premier Authorized Adobe Consulting and Training > > > > http://www.figleaf.com > > > > http://training.figleaf.com > > > > > > > _______________________________________________ > > > Flashcoders@chattyfig.figleaf.com > > > To change your subscription options or search the archive: > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > Brought to you by Fig Leaf Software > > > Premier Authorized Adobe Consulting and Training > > > http://www.figleaf.com > > > http://training.figleaf.com > > > > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com