AS3
I've got a list of job roles populating a custom drop down menu. I hold the jobs in an Array called jobArray. It works and the menu builds from it. No problem.
I'm having one small issue sorting it.
current:
splicedArray = jobArray[i].splice(0,2);
jobArray.splice(0, 0, splicedArray);
// does the same as below -- MovieClip(root).jobArray.splice(MovieClip(root).jobArray.length-1, 1);
jobArray.pop();
The user's courses load based on their default job, but the list of courses changes when they choose courses for their other job roles. They click say drop down item 3, it needs to move to position [0] and move the others down one spot. This works, but my method leaves an undefined item in the number that was clicked.
Eg.
Sales Guy
Service Guy
Warranty Clerk
clicking [2] moves it to [0] no problem and the rest move down.
clicking [1] moves it to [0] and [1] becomes undefined. [2] stays as is.
Any wicked code helpers to help clarify what I am doing?