10 Replies Latest reply on May 14, 2008 4:40 AM by ShanPrathi

    Using DCR as a Cast

    ShanPrathi Level 1
      Hi I have an existing director solution using MIAW to play a series of dcr files.
      The requirement currently is to make the same solution work on internet. I tried to import these dcr files. But the script in these dcr files are not functioning. i get "Cast member not found" and "Property not found " messages. Please help.
        • 1. Re: Using DCR as a Cast
          Level 7
          ShanPrathi wrote:
          > Hi I have an existing director solution using MIAW to play a series
          > of dcr files.
          > The requirement currently is to make the same solution work on
          > internet. I tried to import these dcr files. But the script in these
          > dcr files are not functioning. i get "Cast member not found" and
          > "Property not found " messages. Please help.

          It sounds like the cast has not been fully loaded - you'll need a preloader:
          http://www.mediamacros.com/item/item-986157616/

          More spohisticated:
          http://www.lingoworkshop.com/Articles/netoperations.php

          Andrew


          • 2. Re: Using DCR as a Cast
            ShanPrathi Level 1
            Can somebody help? I am using Director MX 2004 to develop.
            • 3. Re: Using DCR as a Cast
              ShanPrathi Level 1
              Andrew,

              Thanks for the response. I have the dcr files as part of my internal cast library and it is not external. does it still need preloading?
              I am only swapping cast members on a sprite. The dcr loads, but when the code try to set a variable/property resides inside the dcr, it throws up an error.

              • 4. Re: Using DCR as a Cast
                Level 7
                ShanPrathi wrote:
                > Thanks for the response. I have the dcr files as part of my internal
                > cast library and it is not external. does it still need preloading?
                > I am only swapping cast members on a sprite. The dcr loads, but when
                > the code try to set a variable/property resides inside the dcr, it
                > throws up an error.

                Sorry, I misread dcr as cst. You might need to use preloadMember on the
                appropriate members.

                Or, if you look in the Property Inspector with the member selected, under
                the Cast tab there is a Preload option which you can set to "Before frame
                one".

                Also, under the "Linked Movie" tab, you may need to check "Enable Scripts".

                Andrew


                • 5. Using DCR as a Cast
                  ShanPrathi Level 1
                  Hi Andrew,

                  Thank you for the guidance. I enabled the preload option, but the issue still remains. To throw more light, the dcr file loads and all its graphics are displayed. I am able to roll over the buttons. The issue comes when there is a script executed inside dcr and the script attempts setting a variable. for example,

                  tHtml = "<html><body>" && txt && "</body></html>"
                  m = member("hint")
                  m.html = tHtml
                  m.font = "Arial"
                  m.fontSize = 12

                  the above script is executed inside the dcr file. But in the DIR file where this is used as a cast member, it thorws an error "#html property not found".

                  The dcr file works perfectly fine when it is independent. The issue comes only when i import as a cast and use it inside another director movie. Let me know if there are any known solutions.

                  Thanks for your effort.
                  • 6. Re: Using DCR as a Cast
                    Level 7
                    Do you have another member called "hint" in the containing movie? That might
                    make it use the wrong member. Or are you trying to access a member in the
                    imported dcr from a script in the containing movie?

                    If it doesn't find the property .html of m, then either m is void or it's
                    pointing to a member which doesn't have an .html property.

                    Andrew


                    • 7. Re: Using DCR as a Cast
                      ShanPrathi Level 1
                      I will check for any other cast member in the parent movie named "hint". However, when I debug, I found m is void.
                      How do I work around
                      • 8. Re: Using DCR as a Cast
                        Level 7
                        ShanPrathi wrote:
                        > I will check for any other cast member in the parent movie named
                        > "hint". However, when I debug, I found m is void. How do I work around

                        Where is member("hint")? In the containing movie or the dcr?

                        Where is the script?

                        You might need to look up the "tell" command in the help, and note that you
                        can do "tell sprite(x)..." as well as telling a window, e.g. if I have a
                        sprite(1) in a dcr in sprite(2) in a movie I can do

                        tell sprite(2) to put sprite(1).rotation

                        Andrew


                        • 9. Re: Using DCR as a Cast
                          Level 7
                          Andrew Morton wrote:
                          > ShanPrathi wrote:
                          >> I will check for any other cast member in the parent movie named
                          >> "hint". However, when I debug, I found m is void. How do I work
                          >> around
                          >
                          > Where is member("hint")? In the containing movie or the dcr?
                          >
                          > Where is the script?
                          >
                          > You might need to look up the "tell" command in the help, and note
                          > that you can do "tell sprite(x)..." as well as telling a window, e.g.
                          > if I have a sprite(1) in a dcr in sprite(2) in a movie I can do
                          >
                          > tell sprite(2) to put sprite(1).rotation

                          Additionally, it might be easier to add another castLib to the dcr and refer
                          to it explicitly by name

                          m=member("hint", "yourCastName")

                          Andrew


                          • 10. Re: Using DCR as a Cast
                            ShanPrathi Level 1
                            Hi Andrew,

                            I will try out these options.
                            Meanwhile, for your information, the member "hint" is residing in the dcr.