Actionscript 3.0: public, protected, private, and internal

With AS3 have introduced new "instructions" to define properties and methods (public or private). si comportava in AS2 come ora si comporta protected , in AS3 private è davvero “privata” !) proprio a causa dell'introduzione di una sintassi più OO rispetto alle precedenti versioni. Some, such as private - already present in AS2 - changed behavior ( private behaved in AS2 behaves like now protected in AS3 private is really "private"!) just because of the introduction of an OO syntax than previous versions . Better outline, then, from the "public" at most "private":

  • public
    everyone can access it
  • protected
    you can access the parent class and subclasses
  • Private
    only the class that defines
  • Internal
    only within the same package

One Response to "Actionscript 3.0: public, protected, private, and internal"

  1. January 8, 2009 Actionscript 3.0 for beginners: lesson # 2 | Undolog.com :

    [...] Function, or method, init () has been defined as private (see Actionscript 3.0: public, protected, private, and internal) using the private keyword: PLAIN TEXT [...]

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL