How to remove an item from the MP3 Player?
Date: Aug 2, 2007
Views: 1348
Question:
I am having difficulty removing items from the play list. My player is named myPlayer like your examples and I have added one track via myPlayer.addItem().
I have tried multiple methods including myPlayer.removeItem(0) myPlayer.content.removeItem(0) and myPlayer.content.removeItem(myPlayer.content.getItemAt(0)); None of these seem to do the trick.
Otherwise, I have been able to use most of the methods listed in the API. Any help you can give would be great!
Thanks
I have tried multiple methods including myPlayer.removeItem(0) myPlayer.content.removeItem(0) and myPlayer.content.removeItem(myPlayer.content.getItemAt(0)); None of these seem to do the trick.
Otherwise, I have been able to use most of the methods listed in the API. Any help you can give would be great!
Thanks
Answer:
| wigz (Admin) |
We overlooked this in development of the current version. In order to do this, you just have to use the following code (basically doing what we should have done in the removeItem() function if it existed): var itr:mx.utils.Iterator = myPlayer.content.getIterator(); var itemToRemove:Object; while (itr.hasNext()) { itemToRemove = itr.next(); } myPlayer.content.removeItem(itemToRemove); myPlayer.invalidate(); myPlayer.init(); This will be fixed in the next release (free upgrade) - Thanks! ~Wigz |
