18 Replies Latest reply: Jan 11, 2013 8:04 AM by kglad RSS

    A user editable video playlist.

    richhennosy Community Member

      I have a playlist of about 20 videos in list format. Currently, you have to click on the video icon and it plays. I am trying to figure out a way to allow the user to re-order the video list, then play the videos in that new order. All of the tutorials I see online that have to do with playlists requires back end playlist creation, but I need the user to be able to choose the videos they want to play and then have them play in the order they select. Does anyone have any guidance that could help me create this?

        • 1. Re: A user editable video playlist.
          kglad CommunityMVP

          how do you want them to re-order your play list?

          • 2. Re: A user editable video playlist.
            richhennosy Community Member

            I want the user to be able to drag the icons in list view into the order they want to play them. It could be something where the playlist is on one screen, the user reorders the playlist and then presses a play button. The next screen is the video player and the videos start playing in the order that the user put them in.

             

            Thanks for your help.

             

            Rich

            • 3. Re: A user editable video playlist.
              kglad CommunityMVP

              you'll need to fake that.  ie, when a list item is clicked add a movieclip to the stage under the mouse and add that row's data to your movieclip (that you'll make look like a list row) and apply startDrag() to that movieclip and then when it's dropped, remove it and use the mouse position (on startDrag and stopDrag) to reorder your list.

              • 4. Re: A user editable video playlist.
                richhennosy Community Member

                Is it possible to set up a container of sorts that when you press the play button it plays container 1, then container 2, then container 3 etc.

                 

                Then I have all of my movies on the stage, i drag them into the containers putting the movie i want to play first in container one, the movie i want to play second in container two, etc?

                 

                I press play and it starts playing the movie that was dropped into container 1, then on to container 2.

                 

                https://www.dropbox.com/s/rj1cp8ic1qwgaee/container.pdf

                 

                Thanks,

                 

                Rich

                • 5. Re: A user editable video playlist.
                  kglad CommunityMVP

                  sure, you could do that using the same general principle mentioned above.

                  • 6. Re: A user editable video playlist.
                    richhennosy Community Member

                    Ok. I know how to do drag and drop objects. I don't know how to create the containers that would hold the movies and the playlist. Do you know of any tutorials or examples? I feel like I have searched everywhere.

                     

                    Thanks,

                     

                    Rich

                    • 7. Re: A user editable video playlist.
                      richhennosy Community Member

                      My final project is to create an Adobe Air app for playback on an iPad. A sales rep would need to be able to set the play order of the videos according to what client they are talking to. Not all videos are relevant to all customers. The movies are basically slideshows, but they could have a short 1-2 minute video.

                      • 8. Re: A user editable video playlist.
                        kglad CommunityMVP

                        you would create those yourself.  they are a design element that should look like they are drop targets for your play items.

                        • 9. Re: A user editable video playlist.
                          richhennosy Community Member

                          Yes, if I knew how, I would do that. I am looking for help on how to do this. I am looking for examples or tutorials.

                          • 10. Re: A user editable video playlist.
                            kglad CommunityMVP

                            draw a rectangle with a border and background.  convert it to a movieclip and name it play container.

                             

                            drag a few to your stage and assign instance names like container_1, container_2 etc.

                            • 11. Re: A user editable video playlist.
                              richhennosy Community Member

                              Here is where I am. I am having trouble creating the drop zones. I can't find any examples online for creating drop zones. I need my movie clips at the bottom to be able to be dropped into the drop zones at the top. The drop zones need to be coded to play the movie that is dropped on them when you press the play button. I would also like to set up the preview area so that when you drop a movie on it, it will play in the preview area. This will help identify the movie while making the playlist.

                               

                               

                              Screen Shot 2013-01-10 at 4.10.02 PM.png

                              Here is my Code:

                               

                              package

                              {

                                        import flash.display.*;

                                        import flash.events.*;

                               

                               

                                        public class DragDrop extends Sprite

                                        {

                                                  var origX:Number;

                                                  var origY:Number;

                               

                                                  public function DragDrop()

                                                  {

                                                            // constructor code

                                                            origX = x;

                                                            origY = y;

                                                            addEventListener(MouseEvent.MOUSE_DOWN, drag);

                                                  }

                               

                               

                                                  function drag(evt:MouseEvent):void

                                                  {

                                                            stage.addEventListener(MouseEvent.MOUSE_UP,

                              drop);

                                                            startDrag();

                                                            parent.addChild(this);

                                                  }

                                                  function drop(evt:MouseEvent):void

                                                  {

                                                            stage.removeEventListener(MouseEvent.MOUSE_UP,

                              drop);

                                                            stopDrag();

                                                            x = origX;

                                                            y = origY;

                                                  }

                                        }

                               

                               

                              }

                               

                              Thanks for any advice.

                               

                              Rich

                              • 12. Re: A user editable video playlist.
                                kglad CommunityMVP

                                what is DragDrop?

                                 

                                do each of your 5 bottom left sprites extend DragDrop?

                                 

                                is DragDrop your document class?

                                • 13. Re: A user editable video playlist.
                                  richhennosy Community Member

                                  Yes, DragDrop is document class. The bottom 5 movie clips are draggable, but when you let go they snap back to their original position. I don't know how to make the targets at the top interact so that the clips will land on them if you let go inside the square. I also need to set up a play order for the drop zones to play the movies that are dropped in their boundries when you press the play button.

                                   

                                  Thanks,

                                  Rich

                                  • 14. Re: A user editable video playlist.
                                    kglad CommunityMVP

                                    that code needs some major changes.

                                     

                                    but before you get to that part you need to find out what's causing your objects to drag and drop correctly because it's not that code.  that code will causing everything on-stage to drag and drop simultaneously. ie, if you drag one object, you drag them all.

                                     

                                    if you're not seeing that, you're not using that code.  something else is going on.

                                    • 15. Re: A user editable video playlist.
                                      richhennosy Community Member

                                      Actually, this method is in a lynda.com<http://lynda.com> tutorial. Only the movie clips that are bound to the DragDrop class are moving, and only the ones you select. This document was created by scratch. This is the only code in it.

                                       

                                      How would you have executed it? I can cha be methods.

                                       

                                      Thanks,

                                       

                                      Rich

                                       

                                      Sent from my iPhone

                                      • 16. Re: A user editable video playlist.
                                        kglad CommunityMVP

                                        then DragDrop is NOT your document class and each of your 5 bottom left sprites extend DragDrop.  so, your answer to my message 12 is incorrect.

                                         

                                        do you understand what a document class is?  do you understand any of the code you copied?  do you understand how your draggable sprites are related to DragDrop?

                                        • 17. Re: A user editable video playlist.
                                          richhennosy Community Member

                                          Although I am learning, I do understand the tutorials and the concepts presented. My document class is DragDrop and the movie clips do function properly up to this point.

                                           

                                          It is clear to me that you are not interested in helping me with this project. It is understandable why you are the post "leader" on this forum. You provide many comments but not much assistance. Please move on to other posts where you can be of "help" to someone else. I will repost questions in other discussions. Please ignore them.

                                           

                                          Thanks,

                                           

                                          Rich

                                          • 18. Re: A user editable video playlist.
                                            kglad CommunityMVP

                                            i can't remember who to ignore because i respond to so many posts.  and, i'm sorry that you think i'm being unreasonable and unhelpful.

                                             

                                            but, i assure you that you have some basic misunderstanding of what you are doing and you must correct that or you will continue to have problems with that code. 

                                             

                                            to get a second opinion about that, you could post another message with ned murphy's or sinious' name in the title asking for their assesment of your document class code shown in message 11.