12 Replies Latest reply on Aug 30, 2014 1:40 AM by Mister_Mitbewohner

    Are there any Director scripts resp. code beyond "cast members"?

    Mister_Mitbewohner Level 1

      Hi there,

       

      currently I'm working on a big, hardly documented project in Director/lingo without having built it myself. So I'm faced with a lot of problems and questions.

      (I'm working with the German edition, so maybe some of my translated English Director terms are not correct.)

       

      This time I'm facing a very strange behavior of the application. There is a parent script named "PersonalZelle" (personal cell) which has a function named "switchCameraCB". I didn't find any call of this function via text search in other scripts. I already tried chosing to search in "all cast members" (German: "Alle Besetzungen"). But placing a breakpoint there and debugging it, this function is actually used in the running application! Ô.ô How can that be?

       

      So my questions are:

       

      1) Are there any "hidden" scripts/code beyond cast members? If so, how do I find them?

      2) If not, how is it possible to have a function/method being used if no code actually calls it?

       

      Second example:

       

      In another script, there is a variable named piVideoNum. This variable is NOT instanciated and no value is given to it in the whole code. But debugging it, it always has the correct value which it should have. How can that be? Ô.ô where does it take the value from? As far as I know there is no UI-part having this variable attached. In the UI, you have three videos which you can klick, and if klicked, the correct number of the video is saved in piVideoNum. But in the attached behavior script there is nothing. The method which handles the klick calls another method and sends the piVideoNum - without having altered it before. Maybe it's also done by some "hidden" script/code?

       

      Does anyone have an idea? This would be very helpful!

      I need to alter this method, but if I don't know how it is working, there's no possibility...

        • 1. Re: Are there any Director scripts resp. code beyond "cast members"?
          Sean_Wilson Adobe Community Professional

          There is a parent script named "PersonalZelle" (personal cell) which has a function named "switchCameraCB". I didn't find any call of this function via text search in other scripts. I already tried chosing to search in "all cast members" (German: "Alle Besetzungen"). But placing a breakpoint there and debugging it, this function is actually used in the running application! Ô.ô How can that be?

          When the debug window opens, in the top left hand pane you should have access to the handler stack and be able to see which handler called the handler in question.

          Or perhaps it's a callback function from an xtra?

          In another script, there is a variable named piVideoNum. This variable is NOT instanciated and no value is given to it in the whole code. But debugging it, it always has the correct value which it should have. How can that be? Ô.ô where does it take the value from? As far as I know there is no UI-part having this variable attached. In the UI, you have three videos which you can klick, and if klicked, the correct number of the video is saved in piVideoNum. But in the attached behavior script there is nothing. The method which handles the klick calls another method and sends the piVideoNum - without having altered it before. Maybe it's also done by some "hidden" script/code?

          As you say, it must be initialised somewhere. Perhaps it is manipulated directly by another script?

          • 2. Re: Are there any Director scripts resp. code beyond "cast members"?
            Mister_Mitbewohner Level 1

            Hi Sean,

             

            thank you for your reply!

             

            I looked closer to the debug window. But on the left hand side I only can see all variables and objects which re used in the script, and what content they have. I cannot see any handlers (functions/methods) there. I took a snapshot for you, maybe I looked at the wrong place?? I'm using Director 11.5, maybe the function isn't there in this version?

            snapshot Debug switchCamCB.PNG

             

            Some German translations

            for the left hand side:

             

            Alle = all

            Lokal = local

            Eigenschaften = properties

            Global = global

            Name = name

            Wert = value

            Überwachen = supervise

             

             

             

             

             

             

            About a callback function from an Xtra.

            I don't know if there's such an Xtra but I doubt it. This function is called when you klick on different "monitors"  in the UI which show different cam videos. It's direct manipulation. I did not write any of the used Xtras, so how can I look into them? It didn't work with Notepad or Director... to xtras I'm absolutely new.

             

            And the second example with the variable piVideoNum - well, it's a property variable of this script and not manipulated by any other script (I determined by search function) and there's also no funtion in this script, which could be called from another script to alter the variable.

             

            So, as a first result, there are NO "hidden" scripts which is not searched by search function or something. Only xtras could be a way.

             

            New questions are:

            - where's the handler-history in the debug window in Director 11.5?

            - how can I look into an xtra?

             

            Thanks so much for your help so far!

            Jana

            • 3. Re: Are there any Director scripts resp. code beyond "cast members"?
              Sean_Wilson Adobe Community Professional

              Sorry, my mistake. I mis-remembered how the debug window works (I was certain there was an option to view this).

              What about running your program and clicking the "trace" button in the message window just prior to invoking whatever calls the parent script handler, then unclicking the trace button so you're not overwhelmed with info. That, once you wade through it, might help narrow it down.

               

              As far as your second issue goes, perhaps you could "watch" the variable and gain some insight into when it is initialised.

              • 4. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                Mister_Mitbewohner Level 1

                Thank you for the hint with tracing in the message window - I didn't know that this is possible!

                 

                  

                The variable issue:

                 

                I traced everything of the program with the variable from the beginning - just to be sure. And now I'm very depressed - because in the traces the variable piVideoNum is used several times - and it is NEVER given any value! I can see some function is called and given this variable as a parameter, but it is not traced what content the call-parameters actually have! Next step traced is to ask in this called function what value the parameters have: WTF? Ô.ô Where does it get it's f******* value from? (Sorry for my language, I'm deeply falling into despair here... >.<  )

                 

                "Watching" the variable in the object inspector (didn't find another possibility) unfortunately says nothing. It only tells me the new value when klicked - that's what I already knew.

                 

                 

                The method issue:


                Unfortunately this Director project is so big and inefficient that I didn't have a chance to trace the method. I would have had to klick on something on the stage, but while tracing everything which runs in the background and tracing every mouse movement (until I'm there where to klick) it hangs up completely and cannot handle my input at all... O how I hate working on someone else's stuff... >.<

                • 5. Re: Are there any Director scripts resp. code beyond "cast members"?
                  rduane Level 1

                  Regarding the handler stack: it should be right above the part of the screen that you've shown in your screen-grab above i.e. right above the Alle, Lokal, etc. tabs!

                   

                  Regarding the mysterious variable: is it declared as a "property"?  Is there a "getPropertyDescriptionList" handler?

                  • 6. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                    Mister_Mitbewohner Level 1

                    Hi rduane,

                     

                    regarding the  handler stack:

                    I didn't find anything like that. I took another screen shot to show you what buttons and menues there are.

                    In the debug window there are the following buttons from left to right: (translated by me)

                     

                    run script step by step, step into methods, run script, stop debugging

                    breakpoint on/off, ignore breakpoints, follow expression, inspect object

                    object inspector, go to procedure

                    help

                    snapshot Debug switchCamCB suche nach handler stack.PNG

                    I didn't find anything like a handler stack. Is it missing here? Is it something in the button menue above all?

                    What Director version do you use with a handler stack?

                     

                     

                    regarding the variable:

                    yes you're right, the variable IS a property and there's also a handler getPropertyDescriptionList. Here's the code for that:

                     

                    property piVideoNum
                    
                    
                    on getPropertyDescriptionList
                      beschreibung = [:]
                      beschreibung.addProp(#piVideoNum, [#default:1, #format:#integer, #comment:"VideoNum",#range:[#min:1,#max:3]])
                      return beschreibung
                    end
                    
                    

                     

                    (Explaination:  "beschreibung" means "descrition")

                     

                    What does that mean? Unfortunately I'm quite new to most of the structures.

                     

                    Thank you very much for your help!

                    • 7. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                      rduane Level 1

                      regarding the stack:

                       

                      I am also using v11.5 (English version).  But based on the screen grabs you have sent, I think the stack may have been hidden!  Place your cursor over that black line in between the Run, Step, etc buttons and the All, Local, etc. tabs.  Does the cursor change into a double-headed arrow?  If so, click and drag that line down, and I think you just might see your stack appear!

                      • 8. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                        Mister_Mitbewohner Level 1

                        Hey, yeah! There it is! O.O

                        Wow. I never would have guessed THAT. Thank you!!!!!

                         

                        Regarding the variable value, what's this "getPropertyDescritpionList"-thing?

                         

                         

                        Edit:

                        I did not find any handler calling the "switchCamCB", because the calling handler uses another method to calculate the handler name... @_@  of course I can't find it then by using text search. The handler stack will help me VERY MUCH from now on!

                        • 9. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                          rduane Level 1

                          regarding the variable:

                           

                          You should read up in the user manual about the getPropertyDescriptionList, but basically that is a way to give your properties an initial value, and it is done at Authoring time!  Click on one of the videos and then open the Behavior Inspector.  Then click on the two little gears.  These:

                           

                          parameters.png

                           

                          You'll see a dialog box come up that allows you to change the initial value of that property for that video.  What that dialog box looks like and what values are offered as options is determined by that getPropertyDescriptionList handler.  In your case, you are only going to be able to choose between the integers 1, 2, and 3.  (Unless or until you change that handler.)

                          • 10. Re: Re: Are there any Director scripts resp. code beyond "cast members"?
                            Mister_Mitbewohner Level 1

                            Okay, so it's for the initial value. Thanks!

                             

                            But somehow the vlue is changed clicking into the UI without assigning a new value to the variable in any script. Can another script change the value by getPropertyDescritpionList?

                            • 11. Re: Are there any Director scripts resp. code beyond "cast members"?
                              rduane Level 1

                              Well, not exactly.  The beauty of the "property" is that each sprite that uses that behavior has it's own, unique value for that property - it's not like a global variable.  So every time you click on one of the videos, it will use it's own value for that property.  It sounds like in your case they never change, so one of the videos always has a piVideoNum property whose value is set to 1, and another video is set to use number 2.  You get the idea.

                               

                              They are essentially three different variables, and you can see this by going to the correct frame, and then typing in the message window:

                              put sprite(1).piVideoNum

                              put sprite(2).piVideoNum

                              put sprite(3).piVideoNum

                              (except, of course, use the correct sprite numbers), and you'll see the 3 different values.

                              • 12. Re: Are there any Director scripts resp. code beyond "cast members"?
                                Mister_Mitbewohner Level 1

                                hey, wow, you're right.... Director truely has some strange structures... Ô.ô

                                 

                                Until now I only cared for the behavior script which is the same for the 3 videos to klick. But each videao has a different sprite! Didn't recognize that.

                                 

                                 

                                So you could explain all my "mysteries". Thanks a lot! :-)