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
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
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
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
4 matches
Mail list logo