Pages

Showing posts with label Variable type in as3. Show all posts
Showing posts with label Variable type in as3. Show all posts

Thursday, June 21, 2012

How to find Variable type in as3

Object,Array,Number,String,MovieClip,Sprite there are basic variable type in as3.

var a1:Object=new Object();
var a2:Array=new Array();
var a3:Number=new Number();
var a4:String=new String();
var a5:MovieClip=new MovieClip();
var a6:Sprite=new Sprite();
var container:Array=new Array(a1,a2,a3,a4,a5,a6);

here which variable is a Object from container array?

for(var i:int=0;i<container.length;i++)
{
    if(typeof(container[i])=="object")
    trace("this one is object type variable: "+container[i]);
}

...CHeeRS...