14 Replies Latest reply on Aug 30, 2007 7:05 AM by richhennosy

    Shared Object

    richhennosy
      Scenario: On my stage are 4 movie clips (lucy, nike, jd, upfront). I also have 12 hotspots that I can drag the clips onto. The play button, when pressed, plays the movie clips in the order that I have placed them.

      Problem: Once a clip is dropped onto a hotspot, it can't be moved to a new hotspot. Well, it can be moved, but the play order doesn't change to reflect the move.

      Hopeful solution: I would like to be able to move the clips around the stage, drop them on hotspots and rearrange them, then when I have finally decided on a final resting place, be able to save the order so that when I press the play button, it will play the clips in that order.

      Is something Shared object can do? Take a peek at my code and advise please. Thanks.
        • 1. Re: Shared Object
          kglad Adobe Community Professional & MVP
          that's too much code to check carefully. what determines when a movieclip plays? the hotspot it's located on?
          • 2. Shared Object
            clbeech Level 3
            Rich, you already have a 'btnAr' Array, you could just iterate through and pass another array to the SharedObject, and retrieve it for the order on open:
            • 3. Re: Shared Object
              Damon Edwards Level 3
              @kglad: I've been helping him through this from the beginning.. so I'll try and explain a little better.. There are a total of 12 hotspots, at the beginning, only 1 hotspot is made available, and once something is dropped on it, the next hotspot is then pushed into the hotspot array to make it available and the object that was dropped is put into a 'play' array
              playAr.push([goto_ar[this.ivar]]);
              that happens every time an object is dropped onto a hotspot. Then, when the play button is pressed it starts off by gotoAndPlay(playAr[0]); and at the end of each of the movie clips located on those frames, a global variable is set to true, and an interval picks that up and sends you to the next frame in order of the 'play' array gotoAndStop(playAr[indeX++]);... I have spent way to much time with this and can't help on it any longer for free.. That is the gist of it

              @ richhennosy: Sorry I couldn't be of more assistance.
              • 4. Re: Shared Object
                richhennosy Level 1
                Dz,

                You have gone above and beyond already. That is why I have reposted in this area, to see if anyone else is interested in looking at it. Thanks for giving the alternative explanation. I will keep plugging away.

                Rich
                • 5. Re: Shared Object
                  richhennosy Level 1
                  Beech:

                  I pasted your code over my shared object code. I then moved the objects into the hotspots. I moved them around several times, then I pressed the save button. Then I pressed the play button. It played the movies in the order that I first dropped the movies in, not the order they were in when I pressed save. I tried it again using the save button, then the load button, then the play button and I got the same results. Did I miss something?
                  • 6. Re: Shared Object
                    clbeech Level 3
                    sorry Rich, I was mistaken. You need to store both the playAr, and the btnAr positions. this should put the buttons back in order in the hotspot positions, and update the playAr, regardless of how many clips have been stored ... I think :)
                    • 7. Shared Object
                      richhennosy Level 1
                      Kglad:

                      yes, the hotspot determines the play order. But I need it to be at the time that the user presses play, not as they were dropped originally.
                      • 8. Re: Shared Object
                        richhennosy Level 1
                        Cbeech:

                        I am getting a little different result. If I press the save button after arranging several different positions, it still plays according to the original placement. If I press save after arranging them, then press the load button before pressing play, it won't play at all.
                        • 9. Re: Shared Object
                          clbeech Level 3
                          Hey Rich, Ok I've only been following along a little once dz was working with you, so I hadn't been paying much attention to what you guys were doing, and only came back to it when saw the SharedObject question, which I know a little about. So after studying the code for a bit ... Did the system allow you to change the clip play order before? It looks as though once the clip is on the hotspot, there is no method to re-orgainze the play array if you move the clip. If you just move them around (without saving or loading) will the clips play in the new order? I don't think they will. Also this being the case, they should be 'deactivate' so that they can't be changed, cause this could mess things up. Maybe you need a 'reset' button to start the array stacking over again. But I don't see a method to adjust the playAr index positions after the initial placement.

                          could you check this for me.
                          • 10. Re: Shared Object
                            richhennosy Level 1
                            Clbeech:

                            What I have is a stage that has a library of movie clips on the right side and on the left side I have hotspots that make up a timeline. I want the user to be able to drag clips over to the timeline, then when they press play, it goes to full screen and plays the movies in order that they were arranged in the timeline. The problem I am having now is that you have to get your timeline order correct the first time. You can't change the order after you have dropped the movie clips on the hotspot. If you make a mistake on the 10th clip in the timeline, you would have to start over and try again. Is there a way to delay the writing of the timeline info until the user has pressed save or play?
                            • 11. Shared Object
                              clbeech Level 3
                              Yes, I have seen your file online, and understand what your trying to do.
                              ----------
                              "You can't change the order after you have dropped the movie clips on the hotspot. If you make a mistake on the 10th clip in the timeline, you would have to start over and try again. Is there a way to delay the writing of the timeline info until the user has pressed save or play?"
                              ----------
                              Exactly the thing I was wondering about. I think that the hotspot system should be dynamic, in that it should be changable, without having to restart, or reset the whole sequence. Once this is acomplished, we will save the current play order, and then when loading, clear the arrays and reset them with the saved sequence. Let me think about this for a few minutes, and I'll post back. I think you need 'static' positions in the array(s) that get changed by index position, rather than pushed in. need to check to see if this will effect other functions though.
                              • 12. Re: Shared Object
                                richhennosy Level 1
                                That would be most helpful. I think this is the last major roadblock to me creating all of these clips and executing the application.
                                • 13. Re: Shared Object
                                  richhennosy Level 1
                                  What about this. Can I create another timeline on frame 2 that has 12 more hotspots whose sole purpose is to pull the play order from the hotspots that were created on frame 1. Then, when I press play (on frame 1), the movie would go to frame 2, the clip order as it sits on frame 1 is transferred to hotspots on frame 2. Then, when the play button is clicked on frame 2, the movies would play in the final order. This is kind of hokey, but I really need to get this to work.
                                  • 14. Re: Shared Object
                                    richhennosy Level 1
                                    I hate to abandon this app, but it sounds like It won't work as I need it to. I will look into Director, I think it will do what I need, I just don't have much experience with it. I appreciate all the help I have received on these boards. Especially from DZEDWARD and CLBEECH. I am sure I will be back with other posts. Thanks again.