RE: [Flashcoders] Adding a function to the String prototype

2007-02-13 Thread Steven Sacks | BLITZ
You should absolutely feel comfortable and fine using prototype to add functions to the String native object if you want. I say if it works, use it. Just because they skimped on String and Array methods that MOST other languages have doesn't mean you should have to write a bunch of extra code to

RE: [Flashcoders] Adding a function to the String prototype

2007-02-13 Thread Pete Miller
I see, thanx to all. P. >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:flashcoders- >> [EMAIL PROTECTED] On Behalf Of eka >> Sent: Tuesday, February 13, 2007 2:21 PM >> To: Flashcoders mailing list >> Subject: Re: [Flashcoders] Addin

Re: [Flashcoders] Adding a function to the String prototype

2007-02-13 Thread eka
Hello :) If you use the strict typing with "var s:String" you use the AS2 class interpretor and you must override the String.as file in the en/firstRun/classes/FP8 directory in your flash install path. The intrinsic of the String core class must be changed by default in AS2. The String class isn

Re: [Flashcoders] Adding a function to the String prototype

2007-02-13 Thread T. Michael Keesey
Modifying native object prototypes is a hack. Try extending the String class instead: class myPackage.MyString extends String { public function traceFoo():Void { trace("foo"); } } // ... import myPackage.MyString; var s:MyString = new MyString(); s.traceFoo(); If you absolutely must