Hi,
I was hoping I could use a switch statement to test what Object type is
selected on my ADG but I don't think it's possible and need to use an if,
else if, chain...
if ( orgStructureADG.selectedIndex = 0 )
{
switch ( orgStructureADG.selectedItem )
{
case VendorCompcodeData:
In AS3 switch construction uses break - otherwise it'll fall through (all
cases will be executed after the first case that matches the condition).
Besides, you can leave the condition blank and put any statement in the case
block, however, you have to be careful that the cases are unique. Example:
Sorry, typo...
switch ((orgStructureADG.selectedItem as Object).constructor)
{
case VendorCompcodeData:
{
trace( VendorCompcodeData );
}
break;
case VendorPurchorgData:
{
trace( VendorPurchorgData );
}
break;
Ah nice... Cheers Oleg.
I always put my break; statement inside the case brackets. I quite like the
1st way... Easier to read I think.
Thanks,
Nick
On 25 March 2010 12:49, Oleg Sivokon olegsivo...@gmail.com wrote:
In AS3 switch construction uses break - otherwise it'll fall through (all
4 matches
Mail list logo