• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Flash ActionScript: Objects a... > Object-Oriented Theory vs. ActionScr...

Object-Oriented Theory vs. ActionScript Reality

The implementation of classic object orientation within Flash is far less rigorous than in many other languages, like Java or C++.

ActionScript does not provide the security of meaningful encapsulation. We have seen that an object's private functions and data are not protected from other ActionScript entities. In fact, outside code not only can examine and alter any variable in an object, it also can create new variables and install new functions. Any programmer can easily overwrite the native functions of another programmer's object—at run time. Not only can the functions of an individual instance be overwritten, but they can also be overwritten in the actual class definition. In fact, a programmer can change the class definition of someone else's objects, and those objects that are already in place and working will immediately exhibit the new behavior. This is rather dangerous.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint