Question
typeof in AS3
so i used to do sh_t like
switch ( typeof( obj) ){
case "movieclip": etc.
case "string" etc.
}
alot. now i have this 'is' thing im left with really irritating - and probably processor heeavy - multiple ifs like this:
if ( obj is thisObject ){
do this...
} else if ( obj is thatObject ){
do that...
} else if ( obj is otherObject ){
do other
}
usch! very nasty. is there any way i can get back to using my tidy switches instead?
switch ( typeof( obj) ){
case "movieclip": etc.
case "string" etc.
}
alot. now i have this 'is' thing im left with really irritating - and probably processor heeavy - multiple ifs like this:
if ( obj is thisObject ){
do this...
} else if ( obj is thatObject ){
do that...
} else if ( obj is otherObject ){
do other
}
usch! very nasty. is there any way i can get back to using my tidy switches instead?
