Greetings
i’ve written a little button util for a project i am working on.
The problem is that i pass through a variable that first is null, but direct after that it recognizes the correct one.
At first i thought it was due to the fact i want this variable to be optional.
but even without all this, it doesn’t work correctly.
Any way to solve this? … many thanks
its constructor is very simple:
var cc:itemList_CMS = new itemList_CMS ("FOLDER");
the portion of the class
public function itemList_CMS (typeList:String=null):void
{
trace ("type = " + typeList);
//returns first null, then the correct
addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded(e:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, onAdded);
trace ("type = " + typeList)
//does the same, first traces out null, then the correct one.
}