AS3 & Functions

While in class today we discussed Functions and Methods in AS3. I was taken aback when i saw this:


public class myClass {
    public function Programming() {
        function myFunction():void {
        }
        myFunction();
    }
}

That blew my mind! How is this object-oriented? I thought AS3 was supposed to be a step forward in OOP-based standards. Instead, Adobe is enabling spaghetti code. If you need to reuse a block of code, why not make it private? That way you can re-use that piece of code anywhere whenever you need it.

Leave a Reply