7 Replies Latest reply on Nov 5, 2010 5:38 PM by kglad

    Can this be achieved in Flash rather than Flex

    celebritymusic Level 1

      Hi

       

      I found something that's similar to some functionality I need:

       

      http://blog.flexexamples.com/2007/09/19/dragging-rows-between-two-different-flex-datagrid- controls/

       

      I was wondering if this is possible in As3 using Flash CS5?

       

      Thanks

       

      Shaun

        • 1. Re: Can this be achieved in Flash rather than Flex
          kglad Adobe Community Professional & MVP

          yes, but you're not really going to drag and drop a row from one datagrid to another.  you just make it look like you're dragging and dropping a row by attaching a movieclip (with the datagrid row content) and having it drag with the mouse and if released over a dropenabled datagrid, add the item to the 2nd datagrid.

           

          and to really make it look more like a drag and drop, the item should be removed from the first datagrid.

          1 person found this helpful
          • 2. Re: Can this be achieved in Flash rather than Flex
            celebritymusic Level 1

            So you make a movieclip representing what's in the row, attach the actual data to the movieclip, and when you drop it, the attached data populates the row?

             

            Do you know of any tutorials that show this, or parts of what is required?

             

            Thanks kglad

            • 3. Re: Can this be achieved in Flash rather than Flex
              kglad Adobe Community Professional & MVP

              well, you'd make one movieclip that contains dynamic textfields so you can add the dragged rows data to the textfields' text properties.

               

              and i don't know of any tutorials for this.  using google is the best way i've found to find tutorials.  but this is such a narrow task i doubt you'll be successful finding a tutorial.

               

              on the other hand, this is pretty easy if you break it up into a few steps:

               

              1.  create a movieclip (with a linkage id (as2) or class (as3) that contains as many dynamic textfields as columns in your dragged datagrid.  and now that i'm typing this, i can see that this step could be supplanted by dynamically creating a movieclip and adding textfields to it.  that way if you had several datagrids with varying number of columns you wouldn't be restricted or stuck making several movieclips,

               

              2. retrieve the data from the clicked row of the datagrid.

               

              3. apply the data to the text property of your textfields.

               

              4.  drag this movieclip until a mouseup is detected.

               

              5.  on mouseup drop the movieclip.  if it's over a drop-enabled datagrid, add the data to this datagrid and possibly remove the data from the drag-enabled datagrid and remove the movieclip.

              1 person found this helpful
              • 4. Re: Can this be achieved in Flash rather than Flex
                celebritymusic Level 1

                So the datagrid I'm dragging to doesn't have movieclips in it - it justs accepts the textfield data from the dragged clip?

                 

                I'm thinking that I will also need to be able to

                 

                a) reorder the data (in the target grid, using drag and drop)

                 

                b) select multiple rows in the target grid for copying to other parts of it or reordering.

                 

                Is this possible in Flash CS4 or 5, or is it a Flex job?

                 

                Thanks for the insight kglad

                • 5. Re: Can this be achieved in Flash rather than Flex
                  kglad Adobe Community Professional & MVP

                  the datagrid has not textfields.  the textfields are added to a parent movieclip so it "appears" that you're dragging a row of the datagrid.

                   

                  a)  i'm not sure "reordering" is the correct work.  you'll be adding data (to the drop-target datagrid) and possibly removing data from the drag datagrid.

                   

                  b)  if you want to drag and drop more than one datagrid row, that can be done.

                   

                  this can be done with any version of flash that supports the datagrid including older versions of flash and as2.

                  • 6. Re: Can this be achieved in Flash rather than Flex
                    celebritymusic Level 1

                    Ahh - by reorder, I mean that once the data has been dargged to the target dataGrid, I want the ability to drag rows up and down at will.  So Say I drag data in between row 5 and 6 - a new row 6 appears, and then if I want to, I could drag row 6 up in between row 2 and 3, and the old row 6 now becomes the new row 3.

                    • 7. Re: Can this be achieved in Flash rather than Flex
                      kglad Adobe Community Professional & MVP

                      you'll need to encode that.