I'm sure it'd be fine to just prototype in this case, as trim() would be a
useful generic string function, but I don't particularly like the idea of
polluting the String class with other stuff that may not actually be
relevant to strings in general, ie. if I had a URL class with methods
But, isn't that effectively what you are trying to do?
In the statement:-
var myString:TString = "hello world!";
Flash is implicitly creating a literal of type String and then assigning to the variable myString. In order to do what you wanted, you *will* need to redefined the class String or change the default implicit class for creating String literals.
In fact, now that I think about it, the above statement won't work because you are trying to assign an object of type String to variable of a type that is a sub-type of String. You can only assign objects to variables where the object is a sub-type or the same type as the variable. That's assuming the strong typing has been implemented correctly in Flash or specified correctly in the ECMAScript standard that Macromedia is following!
Chris
--- You are currently subscribed to fugli as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
