Re: [Flashcoders] Question about __constructor__
The first thing to understand is that AS2 uses the same bytecode as AS1. i.e. AS2 if just AS1 with pretty makeup and a new hairdo. I can't say better ! Actually all the tricks available for Flash5 are still usefull for flash7. The one you noticed is a trick to link a MovieClip Class with a MovieClip graphic datatype. This is a major problem for lots of developpers in actionscript. Anyhow, use this code to link a custom class to the _root variable. That way, when the timeline will be loaded, you'll get an onLoad callback in your custom class. Nice ain't it ? You could look at this technique in one of Aral's article. "Natural entry point" is the name gave to it : http://aralbalkan.com/429 Cheers. --- erixtekila http://blog.v-i-a.net/ ___ 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] Question about __constructor__
The first thing to understand is that AS2 uses the same bytecode as AS1. i.e. AS2 if just AS1 with pretty makeup and a new hairdo. This page might help you understand more about __proto__ , .prototype and all the weird stuff we did that is thankfully in the past (most of the time) :) http://www.debreuil.com/docs/ch01_Proto.htm Helmut Granda wrote: Erixtekila, Thanks for the link, I have read the site serveral times during the day trying to figure this out. but one of the things I saw is that the code above only helps if you are exporting for flash 5. I still dont understand what this was used since the program that this piece of software powers was made with flash MX and export to flash7 so something else could have been used instead. Thanks again! ___ 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] Question about __constructor__
Erixtekila, Thanks for the link, I have read the site serveral times during the day trying to figure this out. but one of the things I saw is that the code above only helps if you are exporting for flash 5. I still dont understand what this was used since the program that this piece of software powers was made with flash MX and export to flash7 so something else could have been used instead. Thanks again! On 8/17/06, erixtekila <[EMAIL PROTECTED]> wrote: > Could any soul out there help me understand why the __constructor__ and > __proto__ are used in the following code: Check this out : http://www.quantumwave.com/flash/inheritance.html And join the rebel alliance :P (very old private joke, ask others) --- erixtekila http://blog.v-i-a.net/ ___ 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 -- ...helmut :::helmutgranda.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] Question about __constructor__
Could any soul out there help me understand why the __constructor__ and __proto__ are used in the following code: Check this out : http://www.quantumwave.com/flash/inheritance.html And join the rebel alliance :P (very old private joke, ask others) --- erixtekila http://blog.v-i-a.net/ ___ 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] Question about __constructor__
Hello, Could any soul out there help me understand why the __constructor__ and __proto__ are used in the following code: class Application { public static var instance:Application; private function Application(createdBy) { createdBy.__proto__ = this.__proto__; createdBy.__constructor__ = Application; this = createdBy; } public static function main(createdBy:MovieClip){ if(instance == null) instance = new Application(createdBy); return instance; } } //then in the main file Application.main(this); For what I undertand this code is used to assign the whole application to _root but i was looking for a better understanding of "constructor and proto" here. TIA! ...helmut ___ 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