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

  • 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 176
Variable enumeration and object introspection 177
// List accessors as properties:
for each (var a:XML in classInfo..accessor) {
ta1.text += "Property " + a.@name + "=" + button1[a.@name] + " (" +
a.@type +")\n";
}
// List the object's methods:
for each (var m:XML in classInfo..method) {
ta1.text += "Method " + m.@name + "():" + m.@returnType + "\n";
}
}
]]></mx:Script>
<mx:Button label="Submit" id="button1"/>
<mx:TextArea id="ta1" width="400" height="200"/>
<mx:TextArea id="ta2" width="400" height="200"/>
</mx:Application>
The output displays accessors, variables, and methods of the Button control, and appears
similar to the following:
Class mx.controls::Button
...
Variable id=button1 (String)
Variable __width=66 (Number)
Variable layoutWidth=66 (Number)
Variable __height=22 (Number)
Variable layoutHeight=22 (Number)
...
Property label=Submit (String)
Property enabled=true (Boolean)
Property numChildren=2 (uint)
Property enabled=true (Boolean)
Property visible=true (Boolean)
Property toolTip=null (String)
...
Method dispatchEvent():Boolean
Method hasEventListener():Boolean
Method layoutContents():void
Method getInheritingStyle():Object
Method getNonInheritingStyle():Object
Vue de la page 176

Commentaires sur ces manuels

Pas de commentaire