I am scripting a video player and one of its functionalities
is to be able to have a playlist that can be arranged by the user
in any order user like. For Example, if there are lets say 5 videos
within the playlist:
User can then change the order of the videos by clicking on
any video and dragging it up or down just like windows mediaplayer
and the player should play the videos in such order.
So far, I have been able to use the list component but am not
sure if it will allow the dragging.
I would highly appreciate it if you guys can suggest what
should I do to handle this functionality.
Hm, you could define ‘slots’ with rectangles and
each slot would map to a specific slot in some
‘playlist’. Then create your own ‘list
renderer’ that attaches draggable clips based on the playlist
array. During drag and drop, you’d detect which
‘slot’ the movieclip was dropped into, which would
define where in the playlist array it should be inserted.
Then shift the elements around, insert the item in the array,
and rerender the list.
(I’m sure there are probably better/neater ways to do
this as well, this is just quickly off the top of my head).