If I try to call the function using getSkinByName I am getting a null.
Code: Select all
private function onOpenSpaceMapRendered(evt:OpenSpaceEvent) {
trace(openSpace.getAllSkinsByName("TileName")); // returns the name of the associated class
var SkinMC:MovieClip = openSpace.getSkinByName("TileName", "SkiinName") as MovieClip; //no error message
SkinMC.somefunction();//throws a null error - Error #1009: Cannot access a property or method of a null object reference.
}
from the above code the trace message returns an object with a type of the class name of the skin. So the tile is referencing the skin but does not seem to return the instance name.
IN the skin editor, the skin has been named in the title field. In the tile editor, the skin instance properties have been set with the name, in this case the same as the TileName, and there are various triggers set with targets and params. Whether I use the class name, the skin name or the skin instance name I get a null return . Which am I supposed to use to reference the skin and is it possible to call a function using getSkinByName?