Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

Performing Object Introspection

In OOP based programming language object introspection is a technique to determining the elements(properties and methods) of a class at run time.

Ads

Performing Object Introspection

     

 

In OOP based programming language object introspection is a technique to determining the elements(properties and methods) of a class at run time. There are two ways to do introspection in ctionScript:

 

 

  • The introspection API.
  • for..in loops

In the tutorial we'll use getClassInfo() function which is present in ObjectUtil class.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Button;
import mx.controls.Alert;
import mx.utils.ObjectUtil;<country label="India" data="IN"/>
private function disProper(b:Button):void
{
var o:Object=ObjectUtil.getClassInfo(b);
TA.text=ObjectUtil.toString(o);
}
]]>
</mx:Script>
<mx:Button label="Display Properties" id="btn1" click="disProper(btn1)" x="148" y="10"/>
<mx:TextArea width="200" height="300" id="TA" x="124" y="50"/>

</mx:Application>


  

 

Advertisements

Share on Google+Share on Google+

Performing Object Introspection

Posted on: September 27, 2006 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Performing Object Introspection  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads