Re: [Flashcoders] Class overloading question
Thanks all :) Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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] Class overloading question
RTFM @ super() This will call the parent constructor with the parameters you pass to it. That should always be the first line in inherited classes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nik Derewianka Sent: Thursday, June 15, 2006 11:19 AM To: Flashcoders mailing list Subject: [Flashcoders] Class overloading question Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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] Class overloading question
Hello :) you can use the Function Constructor of the SuperClass too class MyClass extends SuperClass { function MyClass ( param ) { trace("test1 in MyClass constructor") ; SuperClass.call(this, param) ; // like super() trace("test2 in MyClass constructor") ; } } EKA+ :) 2006/6/15, André Goliath <[EMAIL PROTECTED]>: Sorry, I ment That should always be the first line in constructors of inherited classes, not the first line of the class itself... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of André Goliath Sent: Thursday, June 15, 2006 12:38 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Class overloading question RTFM @ super() This will call the parent constructor with the parameters you pass to it. That should always be the first line in inherited classes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nik Derewianka Sent: Thursday, June 15, 2006 11:19 AM To: Flashcoders mailing list Subject: [Flashcoders] Class overloading question Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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
RE: [Flashcoders] Class overloading question
Sorry, I ment That should always be the first line in constructors of inherited classes, not the first line of the class itself... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of André Goliath Sent: Thursday, June 15, 2006 12:38 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Class overloading question RTFM @ super() This will call the parent constructor with the parameters you pass to it. That should always be the first line in inherited classes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nik Derewianka Sent: Thursday, June 15, 2006 11:19 AM To: Flashcoders mailing list Subject: [Flashcoders] Class overloading question Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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
RE: [Flashcoders] Class overloading question
RTFM @ super() This will call the parent constructor with the parameters you pass to it. That should always be the first line in inherited classes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nik Derewianka Sent: Thursday, June 15, 2006 11:19 AM To: Flashcoders mailing list Subject: [Flashcoders] Class overloading question Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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] Class overloading question
hello :) in AS1 : _global.SuperSound = function ( mc ) { super (mc) ; } SuperSound.prototype.__proto__ = Sound.prototype ; // inherit in AS2 : class SuperSound extends Sound { // o Constructor function SuperSound( mc ) { super(mc) ; } } You can use "super" to call the superclass constructor You can use "super" too in methods : class SuperSound extends Sound { // o Constructor function SuperSound( mc ) { super(mc) ; this.target = mc ; } // -o Public Properties public var target:MovieClip ; // -o Public Methods public function stop () { super.stop() ; trace("i stop the sound in : " + target) ; } } EKA+ :) 2006/6/15, Nik Derewianka <[EMAIL PROTECTED]>: Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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] Class overloading question
Hi All, Im trying to overload the Sound class to add my own features, it works fine for all the basic features, but what do i need to do with my class to pass through a parameter to the constructor of the superclass ? ie for the var x = new ExtendedSound(my_soundMC), what do i need to call in my class to pass the my_soundMC up to the original Sound class? (ExtendedSound already has extends Sound in its class definition). Regards, -- :: Nik Derewianka :: :: freelance director programmer :: ___ 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