I have a listbox that has several items that will load a path for a movie. If you click an item, the movie plays. I want this to detect the time before a user clicks on an item in the list box. If 10 seconds pass by and the user doesn't select an item, I want it to play my movieclip, PleaseSelectAVideo...
I assume I would start the timer on my stage level... from there it would detect some click on the list... maybe a selection? I dunno. I'm new to this so I'm not sure what events go on a listbox component (Since today is my first time trying to play with one.) If anyone knows how to do this, please lemme know.
_global.timer = setInterval(callListBox,10000);
function callListBox(){clearInterval(_global.timer);
//enter in statement to call the list box and play it}
Inside the list box on your buttons put:
ActionScript Code:
clearInterval(_global.timer);
I used global because I do not know how you have your pathing setup, but this shoudl do the trick ideally.
For lists, if a user selects an item, it fires the "change" event. So use this:
ActionScript Code:
// Name of your list on the stagevar myList:List;
var selectListener:Object = newObject();
selectListener.change = function(event){// event.target is the same as myList// Clear interval// Play the movie}
myList.addEventListener("change",selectListener);