Basically looking for a way to get the instance created when I use this function I’ve made, it seems to me “libItem” will be a new instance and I would like to re-assign that back to the item passed into the function so I can access the instance later.
Here is the helper function I created to create library on the stage…
function objectPlacer( libItem, instance:Class ):void
{
libItem = new instance( );
addChild( libItem );
}
So here is how I call the function
// Function( var name, library item class name, pos x, pos y )
objectPlacer( i_ranks, txt_Ranking );
My problem is, I try to access “i_ranks” later with the following code…
i_ranks.x = 100;
and I get the error: TypeError: Error #1010: A term is undefined and has no properties.
“i_ranks” is defined as a class member.
Also, if you know - what should types should I be assigning the parameters instance and libItem in the function?