10 Replies Latest reply on Feb 26, 2009 6:01 PM by Newsgroup_User

    Cannot Change Member filename using WMV Member Type

    tculley
      Everytime I change the member.filename property of a Windows Media Type i get error "-2147220970"
      1. create new wmv : mem = _movie.newMeber(#windowsmedia)
      2. try to change the filename property: mem.filename = sPath & sFile
      3. I get error -2147220970

      Anyone get the same error.
      Thanks
      todd
        • 1. Re: Cannot Change Member filename using WMV Member Type
          Level 7
          > Everytime I change the member.filename property of a Windows Media Type i get
          > error "-2147220970"
          > 1. create new wmv : mem = _movie.newMeber(#windowsmedia)
          > 2. try to change the filename property: mem.filename = sPath & sFile
          > 3. I get error -2147220970
          >
          > Anyone get the same error.

          I get the same error number cited on the dialog, but only if the file
          doesn't exist. Are you *sure* sPath & sFile point to an existing file
          (that a #windowsMedia member will be able to interpret)?
          • 2. Re: Cannot Change Member filename using WMV Member Type
            tculley Level 1
            Yes...i have 2 video files that i'm using to test with. I can import both of them manually in the cast defined as "windows media player". I can drag one onto the stage and swap sprite.member with the other video but if i create a dummy member or try to change the filename of the member of the one that's already on the stage I get the error message.

            thanks for such quick response. don't know what to do at this point.

            Todd

            • 3. Re: Cannot Change Member filename using WMV Member Type
              Level 7
              What /exactly/ are sPath & sFile? Do they have the correct slashes
              between folders? Is it possible that they get set somewhere to
              incorrect values? Do this:

              put sPath & sFile

              immediately before the command to set the filename. Does that look
              exactly correct?
              • 4. Re: Cannot Change Member filename using WMV Member Type
                tculley Level 1
                yes...they have the correct path and filenames.

                I have a test file setup as follows:
                c:\test\test_wmv.dir
                c:\test\video\500_fullscan.avi
                c:\test\video\500_msms.avi

                sFile1 = "500_fullscan.avi"
                sFile2 = "500_msms.avi"
                sPath = _movie.path

                put sPath & sFile1
                -- c:\test\video\500_fullscan.avi
                put sPath & sFile2
                -- c:\test\video\500_msms.avi

                i have imported both videos in the cast as member("500_fullscan") & member("500_msms").
                i have dragged one of them to the stage and created two buttons to play & pause the video.

                when i play the test file and swap out spite.member with one of the cast members it works. Only when i try to set the sprite.member.filename = sPath & sFile1 or sFile2 do i get the error. For some reason it doesn't like me setting the filename property.

                in the message window i have output the statements prior to setting the filename so i know i am setting the correct path. I'm an advanced director developer with over 7 years experience in it and i do appreciate the suggestion, spelling errors tend to account for alot of errors. I know i'm setting this correctly however and i'm not sure if this is unique to me or other people are experiencing the same behavior.

                The documentation doesn't say you can't set the member's filename property but when i do i get the "error code -2147220970". I'm building a wmv video player to replace and older when built in MX 2004.

                todd
                • 5. Re: Cannot Change Member filename using WMV Member Type
                  Level 7
                  Have you tried using a wmv file as opposed to avi? Or if you are going
                  to use avi files, then perhaps #digitalVideo or #quicktime would be more
                  appropriate than #windowsMedia. Of course, my best option would be to
                  use MpegAdvance for any of them since it is pretty awesome.
                  • 6. Re: Cannot Change Member filename using WMV Member Type
                    Level 7
                    Maybe it's because you're using AVI files.

                    I tested D11hf3 on WinXP SP3 by creating a #windowsMedia member and
                    setting its filename to a valid WMV file, then used the message window
                    to set its filename to an MPEG1 file - with *no* errors.
                    It seems to me that it works properly, and I still suspect your file
                    doesn't exist or is something #windowsMedia can't cope with. How about
                    using Buddy API's baFileExists(sPath & sFile) before setting the filename?
                    • 7. Cannot Change Member filename using WMV Member Type
                      fazstp Level 2
                      What happens if you try to set the fileName of one linked member to that of the other?

                      quote:


                      I have a test file setup as follows:
                      c:\test\test_wmv.dir
                      c:\test\video\500_fullscan.avi
                      c:\test\video\500_msms.avi

                      sFile1 = "500_fullscan.avi"
                      sFile2 = "500_msms.avi"
                      sPath = _movie.path

                      put sPath & sFile1
                      -- c:\test\video\500_fullscan.avi
                      put sPath & sFile2
                      -- c:\test\video\500_msms.avi



                      I know you said you checked for typos but above you say the movie is in c:\Test\ and the videos in c:\Test\Videos\ then you set sPath to _movie.path which would be c:\Test\ so sPath & sFile1 would be c:\Test\500_fullscan.avi
                      • 8. Re: Cannot Change Member filename using WMV Member Type
                        Level 7
                        I just ran the same test but swapped sprite.member.filename to a couple
                        of different AVI files without errors
                        • 9. Re: Cannot Change Member filename using WMV Member Type
                          tculley Level 1
                          I think the issue is with the encoding of the files and the internal initialization in director when you change a member's filename on the fly. However, they both play fine when imported to the cast library as AVI or WMV types.

                          I produced a cd where our client can udpate an xml file and point to their own videos and documents to be played back in my engine. So i built a generic player that uses the dir 11 windowsmedia type to play avi's because it could be any kind of avi or wmv. I have a separate player for .mov.

                          thanks for all your posts,
                          todd



                          • 10. Re: Cannot Change Member filename using WMV Member Type
                            Level 7
                            > I think the issue is with the encoding of the files and the internal
                            > initialization in director when you change a member's filename on the fly.
                            > However, they both play fine when imported to the cast library as AVI or WMV
                            > types.

                            What happens if create a new member and set its filename instead of
                            setting the filename of an existing linked member? Is it worth parsing
                            the extension to determine whether you should create a #digitalVideo or
                            #windowsMedia member?