I thought this was as easy as:

String.prototype.traceFoo = function():Void {
        trace("foo");
}
var s:String = new String();
s.traceFoo();


But that results in an error, "There is no method with the name
'traceFoo'."  Well, duh, traceFoo doesn't exist until the code executes,
but how do you tell the compiler that?  How does one add a function to
String?

P.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to