I'm running into an issue with a Library class not being able to get the correct getQualifiedClassName. Here is my setup.
I have a lot of MovieClips on the stage with instances names like item0, item1, item2 and so on. What I need to do is extend some of those items and give them extra functionality so I opened the items Symbol properties dialog box that I wanted to add a custom Base class to and Checked Export For Actionscript. Kept the Class name the same as the stage instance name. as it needs a unique class name. Then for the BaseClass I added a path to my class that I wanted each item to have extra functionality. The base class was called StageItem which extends MovieClip
In my Main class I add each item to an array.
Actionscript Code:for (var i:int = 0; i < mainContent.numChildren; i++)
{
var child:MovieClip = mainContent.getChildAt( (mainContent.numChildren-1) - i ) as MovieClip;
child.alpha = 0;
itemArray.push(child);
}
Then In another method I do a check on each item in the array to see which ones are of the StageItem class type.
Actionscript Code:trace( itemArray[i] is StageItem);
trace(getQualifiedClassName(itemArray[i]);
the getQualifiedClassName is returning the unique class name which is the same as the instance name which is correct. Example : item0, item1 and so on....
Here lies the problem every item is showing false. to the first trace When it should be showing true for the ones that has a BaseClass of StageItem.
Even when I do a trace to see if its of a MovieClip type it still traces fales.
trace( itemArray[i] is MovieClip);
Is this something to do with having Class names been created by flash in the Symbol properties dialog box. I can't see any other way to give certain Libray assets a custom base class any other way.
Anyone know why this would happen.