MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manuel d'utilisateur Page 39

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 184
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 38
Miscellaneous 39
__proto__
ActionScript 3.0 does not support “hacking” the prototype chain. The use of __proto__ is no
longer supported. For example:
ActionScript 2.0:
Class A {}
var a: A = new A;
trace(a.b) // Output: undefined
a.__proto__.b = 10 // Ok
trace(a.b) // Output: 10
class C {
var x:Number = 20;
}
var c:C = new C();
a.__proto__ = C.prototype;
trace(a.x); // Output: 20
ActionScript 3.0:
class A {}
var a: A = new A
trace(a.b) // Output: undefined
a.__proto__.b = 10 // Error, __proto__ unsupported.
// Use .constructor.prototype instead.
a.constructor.prototype.b = 10; // Ok
trace(a.b) // Output: 10
class C {
var x:Number = 20;
}
var c:C = new C();
a.__proto__ = C.prototype; // Error, __proto__ unsupported.
// .constructor.prototype is equivalent,
// though read only.
Primitive types
Primitive types are sealed classes and do not have object wrappers. Primitive types in
ActionScript 3.0 are final, sealed classes. Furthermore, there are no object wrappers for
primitives. As a result, you cannot create properties on them at run time; for example:
ActionScript 2.0:
newstring = new String("hello");
newstring.sayHi = function() {
trace("hi!");
}
newstring.sayHi();
newstring2 = "hello";
Vue de la page 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 183 184

Commentaires sur ces manuels

Pas de commentaire

Medion Telewizory i monitory podręczniki użytkownika

Zaczynanie od F

Kliknij na poniższy alfabet, aby przejść do pełnej listy modeli zaczynających się od tej litery

Modele Rodzaj dokumentu
FLAT PANEL LCD TFT MONITOR
Instrukcja Użytkownika   CHAPTER 2. Hardware Spec of DSN-5750, 15 strony
Instrukcja Obsługi   Medion FLAT PANEL LCD TFT MONITOR Service manual, 25 strony