![]() Var appendCounter : AppendCounter = new AppendCounter() To be fair to OOP, there is another way of doing this: Text = text.replace( regExp, counterAppenderMaker() ) Var regExp : RegExp = new RegExp( "Photo", "g" ) Trace( myFriend ) //1120: Access of undefined property myFriend.īut things get wacky when functions return other functions: Normally, local variables die after functions are through running: Before I explain that use, let me go over what closures are and how they work. From time to time, I've read that you can use closures in Actionscript, but I've never found a use for them until now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |