Hi Everyone,
Please I need a help with my problem i’m making a time report app for workers in my company"Air Desktop App" the user choose his work shift and after choosing a list with names appears and he can delete the names that didn’t come today the problem that i’m facing that after he clicks the name and delete it i want the rest of the names in the list adjust its y position.
// myArray a is just a sample array that holds the name of the workers
var myArray:Array = ["dum1","dum2","dum3","dum4"];
// redBox is a sample movieclip in the library that contains a dynamic text field with instance name txt the names from myArray will show up in it
var snowBox:redBox;
var asd:String;
var num:int;
function attachRedBoxes()
{
for (var i:Number = 0; i < myArray.length; i++)
{
snowBox = new redBox();
addChild(snowBox);
snowBox.y = i * snowBox.height;
snowBox.name = "snowBox" + i;
snowBox.txt.text = myArray*;
snowBox.x = 100;
snowBox.addEventListener(MouseEvent.CLICK,redBtnClick);
}
}
function redBtnClick(event:MouseEvent):void
{
asd = event.target.name.toString();
num = int(asd.replace("snowBox",""));
myArray.splice(num,1);
removeChild(getChildByName("snowBox"+num));
////// here i want a code to adjust the left movieclips y pos
}
attachRedBoxes();
Thanks in Advance waiting for your help please and if there is any thing that isn’t clear please contact me