Re: [Flashcoders] closures
AS3 is based entirely on closures. Not sure what you mean by it being an option. Anthony Pace wrote: I was wondering if anyone here uses closures in AS3? I like them a ton; yet, I am wondering if they are ever used in a real world development projects in AS3? Can you see an excuse for using them? I know it does make somethings easier to port to and from JS if coded right. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] closures
JS style Function scope instead of classical oop. Steven Sacks wrote: AS3 is based entirely on closures. Not sure what you mean by it being an option. Anthony Pace wrote: I was wondering if anyone here uses closures in AS3? I like them a ton; yet, I am wondering if they are ever used in a real world development projects in AS3? Can you see an excuse for using them? I know it does make somethings easier to port to and from JS if coded right. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] closures
You mean like button.onRelease = function() { trace(hello from + this); obviously not in AS3, you would have to write few more lines... I guess it's okay as long as it works and does what you want along with the hope that you can easily fix it when it breaks in the latest browser 6 months down the line :) Questions is/are: Are you writing code you want to re-use? Are you wanting to decouple stuff? Are you wanting to make stuff easy to fix? Are you just chucking something together? There are loads of arguments for and against I guess, it's just what you are happy working with and what suits the job. Glen Anthony Pace wrote: JS style Function scope instead of classical oop. Steven Sacks wrote: AS3 is based entirely on closures. Not sure what you mean by it being an option. Anthony Pace wrote: I was wondering if anyone here uses closures in AS3? I like them a ton; yet, I am wondering if they are ever used in a real world development projects in AS3? Can you see an excuse for using them? I know it does make somethings easier to port to and from JS if coded right. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] closures
JS style Function scope instead of classical oop. You mean like button.onRelease = function() { trace(hello from + this); (I know that was said tongue in cheek, so this is not a criticism...) that's going back to AS1/AS2 anonymous functions - why would anyone in their right mind, unless they had to target earlier versions of Actionscript, want to go back to that? Jason Merrill Bank of America Global Learning Learning Performance Soluions Monthly meetings on making the most of the Adobe Flash Platform - presented by bank associates, Adobe engineers, and outside experts in the borader multimedia community - join the Bank of America Flash Platform Community (note: this is for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] closures
Hi, I was sort off slightly off the mark with my example, but having read up on function closures in AS3 I can sort of see what Anthony means... From what I gather, Function Closures in AS3 are any functions / methods, but people generally mean functions outside of classes when they talk about function closures, so my example was sort of there somehow.. Anyway, you may need global functions and package functions - I guess these would be considered okay by most OOP people, whereas some people may shun timeline code, although you can use it in AS3 and you can do some very quick tests with it. Like I said before, it's down to choice and whether it suits your needs, so if you need to nest functions, or whatever, it might be easier and more efficient to do so, it might not - depends on your brief/spec I guess. Sometimes just writing functional code is really nice and therapeutic for me, but it never seems to scale very nicely beyond a certain point (probably because I have learned too much about classes and objects to go back). Glen Merrill, Jason wrote: JS style Function scope instead of classical oop. You mean like button.onRelease = function() { trace(hello from + this); (I know that was said tongue in cheek, so this is not a criticism...) that's going back to AS1/AS2 anonymous functions - why would anyone in their right mind, unless they had to target earlier versions of Actionscript, want to go back to that? Jason Merrill Bank of America Global Learning Learning Performance Soluions Monthly meetings on making the most of the Adobe Flash Platform - presented by bank associates, Adobe engineers, and outside experts in the borader multimedia community - join the Bank of America Flash Platform Community (note: this is for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] closures
I was wondering if anyone here uses closures in AS3? I like them a ton; yet, I am wondering if they are ever used in a real world development projects in AS3? Can you see an excuse for using them? I know it does make somethings easier to port to and from JS if coded right. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders