topical media & game development

talk show tell print

lib-flex-animation-code-10-org-as3lib-utils-isPrimitive.ax

lib-flex-animation-code-10-org-as3lib-utils-isPrimitive.ax (swf ) [ flash ] flex


  package org.as3lib.utils
  {
          import flash.utils.*;
          
          
Checks to see if the class of <code>instance</code> is a primitive which will be referenced by value rather than by pointer. The primitive types checked for are : Number int uint String Boolean
author: Mims Wright
parameter: instance - the object whos class you want to check.
returns: true if instance is is a primitive value.

  
           // todo test
           // todo move to ClassUtils?
          public function @ax-lib-flex-animation-code-10-org-as3lib-utils-isPrimitive(instance:*):Boolean {
                  if (!isNaN(instance)) return true;
                  if (instance is String) return true;
                  if (instance is Boolean) return true;
                  //AE if (instance is void) return true;
                  return false;
          }
  }
  


(C) Æliens 19/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.