4 Replies Latest reply on Jul 30, 2012 12:12 AM by Sean_Wilson

    Need Help with MIAW Issue

    Rod@FOF Level 1

      Background:

       

      A. I have a movie that works as a menu to open other movies. For example here is code in a mousedown handler over a list:

         ......

        case (x) of

          1:

            gmiaw = "RooferManual_Hazards_in_Roofing_Waterproofing"

            lframe = 8

            --      go to frame 8 of movie "RooferManual_Hazards_in_Roofing_Waterproofing"

          2:

            gmiaw = "RooferManual_Your_Role_in_Safety"

            lframe = 6

            --      go to frame 6 of movie "RooferManual_Your_Role_in_Safety"

          3: etc

        end case

         .........

         go to frame lframe of movie gMiaw -- I know this is not a MIAW.  I use the term for simplicity.

       

      B. When it opens the new movie, it closes the menu movie. When the new movie is done, the new movie is re-opened. This has worked perfectly for about 8 years.

       

      C. Recently, the client has asked for the ability to have a MIAW open up along side each new movie that can contain "instructor" notes. This I have been able to do, using a movie called "notes."

       

      When an arrow at bottom of a screen in a movie is clicked, the "notes" movie opens in a "sidebar." The movie contains two fields, one for the location of the note (moviename + frame number in the movie. These fields are saved into a notes folder as .txt files, and when present are loaded into the "notes" movie when it opens, or, when added by a user, are saved in that file. PHEW!

       

      This actually works pretty good -- when I run any individual movie, not using the menu to access the movie (either as projector or in author mode in MX 2004).

       

      Problem:

       

      Unfortunately, When the movie is called from the menu using the code in A., those movies where I have inserted the MIAW notes option, return an error that says, for example,

       

      "Unable to open file <the movie path> <the movie name> because it is already open with permission by another user."

       

      This does not happen in movies where I have yet to install the notes option.

       

      I have followed the problem to the end of the "menu" movie, using break points and puts for the windowlist and I see no other window open (I get a [] for the result) nor the writing of any global value which would indicate another movie is open. Below is part of my stopMovie code to try to make sure I have no other windows open.

       

      on stopMovie

        window("notes").forget()

        lWindows= the windowlist

        q = lWindows.count

       

      if the windowlist <>[] then

          repeat with i = 1 to q

            n= getat(lWindows,i)

            forget window(n)

          end repeat

        end if

       

      I also have tried break points at the prepare movie and start movie handlers in the beginning of the new movie being opened, but it never reaches it.

       

      Finally, here is code used on the arrow button within the new movie to create the "notes" MIAW. This code is used in a mousedown handler. At this point in time, I am doing nothing in the beginsprite handler for the behavior attached to the arrow to create the MIAW. So I can't see what effect it might be having at all. Beyond that, I HAVE NO IDEA WHAT IS GOING ON AND DON'T KNOW WHAT TO DO NEXT!

       

      On mousedown

          x= the moviename

           olditemdelimiter = the itemdelimiter

           the itemdelimiter = "."

             y = x.item[1]

             gTheNotesLocation = the moviepath & Y & "Notes"

             gTheNotesName = "S" & gFrame --gFrame is the current frame in the movie

             NotesName = y && "S" & gFrame

             window("notes").movie.member("moviename").text = NotesName

           the itemdelimiter = olditemdelimiter

       

             Result = baFolderExists( gtheNotesLocation )

             put result ........., etc. rest is just preparing folder and location..........

       

      Can anyone tell me what is going wrong or give me a pathway for finding out?

       

      Thanks,

       

      Rod Wolford

        • 1. Re: Need Help with MIAW Issue
          Sean_Wilson Adobe Community Professional

          I'd like to help, but I have difficulty visualising your problem.

           

          You are getting a "locked" message from Director when trying to use movie.go() to navigate to a different Director file, but only when trying to navigate to a movie file in which you have added code to set up a MIAW. If you navigate to a movie where you haven't made any alteration it works as expected. Is that a correct summation?

           

          You then posted some code you say is related to creating a MIAW. However, the code you posted doesn't create a MIAW, but rather changes the text of an existing member in a pre-existing window. Show us the code that instantiates the window object (sets its filename and issues the open() command). Either that, or upload somewhere an archive of files that demonstrates the problem so I (or someone else) can poke around in them.

          1 person found this helpful
          • 2. Re: Need Help with MIAW Issue
            Rod@FOF Level 1

            Thank you so much for your response. I consider you one of the heroes keeping Director going. I actually think I have solved the problem, but I don’t understand why what I have done solves it. Maybe you can explain it to me.


            Regards your first point (marked 1., below), you are correct. It only occurred as stated “when trying to navigate to a movie file in which < I > have added code to set up a MIAW. If < I > navigate to a movie where < I > haven't made any alteration it works as expected.”

             

            1. You are getting a "locked" message from Director when trying to use movie.go() to navigate to a different Director file, but only when trying to navigate to a movie file in which you have added code to set up a MIAW. If you navigate to a movie where you haven't made any alteration it works as expected. Is that a correct summation?

             

            Regards your second point (marked 2., below), you are not quite correct. I believe the code you are referring to in which I refer to the MIAW has a comment which indicates it is not an MIAW, that I just use the designation MIAW as a simplification for my own purposes. ( This is what I posted to which I think you refer:  go to frame lframe of movie gMiaw -- I know this is not a MIAW. I use the term for simplicity.)  I realize I am simply navigating to an new movie.

             

            2. You then posted some code you say is related to creating a MIAW. However, the code you posted doesn't create a MIAW, but rather changes the text of an existing member in a pre-existing window.


            From that standpoint, there is no instantiation of this movie “gMiaw” as a window. Instead, it simply should open the new movie named “gMiaw” going to the designated frame, while closing the “Menu” movie (that code for closing the Menu movie wasn’t provided, but I chose to open and close the movies while navigating between them to keep overhead low – remember, developed 8+ years ago).

             

            It is here, when going to the new movie, when I had been getting the error: "Unable to open file <the movie path> <the movie name> because it is already open with permission by another user." 

             

            Now, since making this post, I found a segment of my code presented in the post which wasn't exactly as I said it was in the movie. In the post, I said: gTheNotesLocation = the moviepath & Y & "Notes"  This was actually in my code book, but not what ended up in the movie.

             

            What ended up in the movie was  gTheNotesLocation = the moviepath & Y" , where Y was the name of the movie being opened. This was defined in the mousedown handler as follows:

             

            x= the moviename

              olditemdelimiter = the itemdelimiter

              the itemdelimiter = "."

              y = x.item[1]

              gTheNotesLocation = the moviepath & Y

              olditemdelimiter = the itemdelimiter

               Result = baFolderExists( gtheNotesLocation )

               If result = 0 then

              baCreateFolder(gtheNotesLocation)

             

            As a result, I ended up creating a folder that had the same name as the movie in which the text files for each frame would then be stored. 

             

            MIRACLE: When I modified my folder creation text to add the suffix "notes" to the folder name created in which the .txt files for the frames would be stored, the problem went away!


            x= the moviename

              olditemdelimiter = the itemdelimiter

              the itemdelimiter = "."

              y = x.item[1]

              gTheNotesLocation = the moviepath & Y & "Notes"

              olditemdelimiter = the itemdelimiter

               Result = baFolderExists( gtheNotesLocation )

               If result = 0 then

              baCreateFolder(gtheNotesLocation)

             

            No more "already open with permission by another user."

             

            So, now, my big question is WHY? Why does a folder that matches a movie name created by the code above appear as an open movie? Or is that what is happening? This is especially confounding because the opening of the folder with the movie name does not even occur on the start movie or begin sprite handlers. It only occurs with the mousedown handler on the arrow button that opens the MIAW "notes.dir" to record the instructor notes (yes, this is an MIAW, but it is just called "notes" and is used as a "vessel" to contain the related frame notes. The only clue I have found was a statement concerning MIAWs made a couple of years ago which states that you "do not have to include the extension (dir, dxr) on a movie to be placed into a window to open it." Does this somehow suggest that the folder using the movie name is viewed as an open movie?? I don't understand.

             

            Once again, I thank your for your response and hope you can clarify for me what might be happening and why. Additionally, I should say I have no problem uploading all code or any associated behaviors if the may prove of any value in answering my question.

             

            Thank you,

             

            Rod Wolford

            • 3. Re: Need Help with MIAW Issue
              Rod@FOF Level 1

              Sean,

               

              Thank you so much for your response. I consider you one of the heroes keeping Director going. I actually think I have solved the problem, but I don’t understand why what I have done solves it. Maybe you can explain it to me.

               

              Regards your first point (marked 1., below), you are correct. It only occurred as stated “when trying to navigate to a movie file in which  because it is already open with permission by another user." 

               

              Now, since making this post, I found a segment of my code presented in the post which wasn't exactly as I said it was in the movie. In the post, I said: “gTheNotesLocation = the moviepath & Y & "Notes"”   This was actually in my code book, but not what ended up in the movie.

               

              What ended up in the movie was  “gTheNotesLocation = the moviepath & Y" , where Y was the name of the movie being opened. This was defined in the mousedown handler as follows:

               

               

               

              x= the moviename

               

                olditemdelimiter = the itemdelimiter

               

                the itemdelimiter = "."

               

                y = x.item[1]

               

                gTheNotesLocation = the moviepath & Y

               

                olditemdelimiter = the itemdelimiter

               

                 Result = baFolderExists( gtheNotesLocation )

               

                 If result = 0 then

               

                baCreateFolder(gtheNotesLocation)

               

              As a result, I ended up creating a folder that had the same name as the movie in which the text files for each frame would then be stored. 

               

              MIRACLE: When I modified my folder creation text to add the suffix "notes" to the folder name created in which the .txt files for the frames would be stored, the problem went away!

               

              x= the moviename

               

                olditemdelimiter = the itemdelimiter

               

                the itemdelimiter = "."

               

                y = x.item[1]

               

                gTheNotesLocation = the moviepath & Y & "Notes"

               

                olditemdelimiter = the itemdelimiter

               

                 Result = baFolderExists( gtheNotesLocation )

               

                 If result = 0 then

               

                baCreateFolder(gtheNotesLocation)

               

              No more "already open with permission by another user."

               

              So, now, my big question is WHY? Why does a folder that matches a movie name created by the code above appear as an open movie? Or is that what is happening? This is especially confounding because the opening of the folder with the movie name does not even occur on the start movie or begin sprite handlers. It only occurs with the mousedown handler on the arrow button that opens the MIAW "notes.dir" to record the instructor notes (yes, this is an MIAW, but it is just called "notes" and is used as a "vessel" to contain the related frame notes. The only clue I have found was a statement concerning MIAWs made a couple of years ago which states that you "do not have to include the extension (dir, dxr) on a movie to be placed into a window to open it." Does this somehow suggest that the folder using the movie name is viewed as an open movie?? I don't understand.

               

              Once again, I thank your for your response and hope you can clarify for me what might be happening and why. Additionally, I should say I have no problem uploading all code or any associated behaviors if the may prove of any value in answering my question.

               

              Thank you,

               

               

               

              Rod Wolford

               

               

               

              PS: I have also posted this response on the forum.

              • 4. Re: Need Help with MIAW Issue
                Sean_Wilson Adobe Community Professional

                Rod@FOF wrote:

                Does this somehow suggest that the folder using the movie name is viewed as an open movie??

                While I've never experienced this problem, I can only think that the answer is yes and that somehow having a folder with the same name as a Director movie file (sans extension), in the same directory as the movie file, has screwed with Director's tiny mind!