RE: [Flashcoders] Object.registerClass ...
Together with "__Packages" you can also use Object.registerClass to bind a class to a dynamically created movieclip. If used in conjunction with a static create method you can make creating extended movieclip instances real easy... // MyClass.as class com.misuseit.MyClass extends MovieClip { public static var LINKAGE_ID:String = "__Packages.com.misuseit.MyClass"; public static var SYMBOL_OWNER:Function = MyClass; public static var SYMBOL_LINKED:Boolean = Object.registerClass( LINKAGE_ID, SYMBOL_OWNER ); private static var $nextId:Number = 0; public static function create( parent:MovieClip, name:String, depth:Number, init:Object ) :MyClass { var mc:MovieClip; name= name || "MyClass" + ( $nextId++ ); depth = depth || parent.getNextHighestDepth(); mc = parent.attachMovie( LINKAGE_ID, name, depth, init ); return MyClass( mc ); } } // To instantiate on a timeline var myClip:MovieClip; myClip = MyClass.create( this ); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: 18 March 2007 10:24 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Object.registerClass ... Stephen. Object.registerClass is used all the time in AS2 to connect library objects to implementing classes - so it's definitely relevant. Essentially, you use Object.registerClass to tell the system what type of class should be associated with a clip when it is attached via attachMovie(). It's the same as specifying the linkage in the linkage dialog, but is done dynamically in the code (and therefore it's possible to attach the same symbol as different classes, if you need to - it's also handy if your library is supplied by a graphic designer who isn't informed enough to insert the appropriate linkages.) HTH, Ian On 3/18/07, Stephen Ford <[EMAIL PROTECTED]> wrote: > Is Object.registerClass no longer relevant when using AS2 and OOP structure.I understand AS2 class structure, inheritance, etc but am trying to understand how it was done in AS1 and if I need to know any of the techniques used before AS2. ___ 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
Re: [Flashcoders] Object.registerClass ...
Stephen. Object.registerClass is used all the time in AS2 to connect library objects to implementing classes - so it's definitely relevant. Essentially, you use Object.registerClass to tell the system what type of class should be associated with a clip when it is attached via attachMovie(). It's the same as specifying the linkage in the linkage dialog, but is done dynamically in the code (and therefore it's possible to attach the same symbol as different classes, if you need to - it's also handy if your library is supplied by a graphic designer who isn't informed enough to insert the appropriate linkages.) HTH, Ian On 3/18/07, Stephen Ford <[EMAIL PROTECTED]> wrote: Is Object.registerClass no longer relevant when using AS2 and OOP structure.I understand AS2 class structure, inheritance, etc but am trying to understand how it was done in AS1 and if I need to know any of the techniques used before AS2. ___ 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
Re: [Flashcoders] Object.registerClass ...
Object.registerClass is the dynamic version of connecting a movieclip in your library with an external class. As far as i know, internally there is no other way, methods are bound to an object. you should look for the keyword "prototyp" and you will gain a wider knowledge :) Stephen Ford schrieb: Is Object.registerClass no longer relevant when using AS2 and OOP structure.I understand AS2 class structure, inheritance, etc but am trying to understand how it was done in AS1 and if I need to know any of the techniques used before AS2.Thanks.___ 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] Object.registerClass ...
Is Object.registerClass no longer relevant when using AS2 and OOP structure.I understand AS2 class structure, inheritance, etc but am trying to understand how it was done in AS1 and if I need to know any of the techniques used before AS2.Thanks.___ 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
RE: [Flashcoders] Object.registerClass
My bad. Thx! -mL -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of slangeberg Sent: Wednesday, September 20, 2006 6:24 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Object.registerClass Mark said: > pass the movieclip into the constructor of the movieclip Did you mean to say: pass the movieclip into the constructor of the class? Scott On 9/20/06, Mark Lapasa <[EMAIL PROTECTED]> wrote: > > What I normally do in this case is pass the movieclip into the constructor > of the movieclip a.k.a. Decorator Design Pattern > > http://en.wikipedia.org/wiki/Decorator_pattern > > So rather than other objects dealing with the movieclip directly, they > deal > with the interface of the class you decorate the movieclip with. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Patrick > Matte > Sent: Wednesday, September 20, 2006 4:43 PM > To: Flashcoders mailing list > Subject: [Flashcoders] Object.registerClass > > > Flash help says that registerClass works with the attachMovie method but I > was wondering if there was any way to register a class to a MovieClip > created with the createEmptyMovieClip method. > > > ___ > 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 > -- : : ) Scott ___ 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
Re: [Flashcoders] Object.registerClass
Patrick, Take a look at this entry in the wiki: http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_movieclip_without_a_symbol_in_the_library It's almost certainly what you're trying to do. Cheers, Ian On 9/20/06, Patrick Matte <[EMAIL PROTECTED]> wrote: Flash help says that registerClass works with the attachMovie method but I was wondering if there was any way to register a class to a MovieClip created with the createEmptyMovieClip method. ___ ___ 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
Re: [Flashcoders] Object.registerClass
Mark said: pass the movieclip into the constructor of the movieclip Did you mean to say: pass the movieclip into the constructor of the class? Scott On 9/20/06, Mark Lapasa <[EMAIL PROTECTED]> wrote: What I normally do in this case is pass the movieclip into the constructor of the movieclip a.k.a. Decorator Design Pattern http://en.wikipedia.org/wiki/Decorator_pattern So rather than other objects dealing with the movieclip directly, they deal with the interface of the class you decorate the movieclip with. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Patrick Matte Sent: Wednesday, September 20, 2006 4:43 PM To: Flashcoders mailing list Subject: [Flashcoders] Object.registerClass Flash help says that registerClass works with the attachMovie method but I was wondering if there was any way to register a class to a MovieClip created with the createEmptyMovieClip method. ___ 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 -- : : ) Scott ___ 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
RE: [Flashcoders] Object.registerClass
What I normally do in this case is pass the movieclip into the constructor of the movieclip a.k.a. Decorator Design Pattern http://en.wikipedia.org/wiki/Decorator_pattern So rather than other objects dealing with the movieclip directly, they deal with the interface of the class you decorate the movieclip with. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Patrick Matte Sent: Wednesday, September 20, 2006 4:43 PM To: Flashcoders mailing list Subject: [Flashcoders] Object.registerClass Flash help says that registerClass works with the attachMovie method but I was wondering if there was any way to register a class to a MovieClip created with the createEmptyMovieClip method. ___ 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] Object.registerClass
Flash help says that registerClass works with the attachMovie method but I was wondering if there was any way to register a class to a MovieClip created with the createEmptyMovieClip method. ___ 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