How Can I Detect A Data Type in AS3
Posted
by Jascha
on Stack Overflow
See other posts from Stack Overflow
or by Jascha
Published on 2010-04-01T02:50:45Z
Indexed on
2010/04/01
2:53 UTC
Read the original article
Hit count: 435
I'd like to make a call to a function and send either a string or an integer...
function getImage(val:*):void{
if(val == String){
switch(val){
case'next':
loadNext();
break;
case'prev':
loadPrev();
break
}
}
}else{
loadImg(val);
}
}
and vary my function accordingly... anyone know how to detect the parameter type?
Thanks -J
© Stack Overflow or respective owner