
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
202
|
Chapter 6: Inheritance
Built-in String intrinsic class definition on Mac:
HD:/Users/USER/Library/Application Support/Macromedia/Flash MX 2004/
LANGUAGE CODE/Configuration/Classes/String.as
Here’s an excerpt from a modified version of the String.as intrinsic class definition. It
shows only the new method and doesn’t show the rest of the intrinsic class definition:
//***********************************************************************
// ActionScript Standard Library
// String object
//***********************************************************************
intrinsic class String
{
// We add this line to the file so that the compiler
// knows about our new isEmpty( ) method
function isEmpty( ):Boolean;
}
The String.as fix itself has a problem: it must be implemented on every computer
that uses the String.isEmpty( ) method. That is, if you fix the String.as file on your
work computer and then take your work home, you’ll have to fix it on your home
computer too. This makes the source code distribution for any application that uses
String.isEmpty( ) very awkward, particularly if more than one application on your
system requires changes to the String.as file! Hence, as mentioned earlier, you should
use this technique only when absolutely necessary, and you should be particularly
hesitant ...