Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the type in flex

can someone tell me how I can identify the type of an object in flex? In particular I have an array where I store multiple types in (but all UIComponents) now as I evaluate the array I want to find out whether I have a TextInput Control or a RadioButton. Does someone have an idea?

Thanks in advance

like image 975
Sebastian Müller Avatar asked Jun 24 '09 09:06

Sebastian Müller


2 Answers

You can either test against a particular class using the "is" operator or you can use flash.utils.getQualifiedClassName() (you pass it your object) - which will return a string of the fully qualified class name.

like image 128
Branden Hall Avatar answered Sep 21 '22 17:09

Branden Hall


ITS WORKING :)

Following is the way I solved this issue

switch( true )
   {
    case item is Customer_SF:
     c = item as Customer_SF;
     break;

    case item is Opportunity:
     o = item as Opportunity; 
     break;

    case item is Product:
     o = ( item as Product )._opportunity;
     break;
    default:
     return true;
   }
like image 32
2 revs, 2 users 89% Avatar answered Sep 20 '22 17:09

2 revs, 2 users 89%