8 Replies Latest reply on Sep 19, 2006 9:44 PM by extol

    newTexture errors?!

    extol
      I am creating an overlay in my 3d scene using newTexture. It works fine in Director, but when I publish it and run it in Shockwave, I get the error that "Shockwave has script erros and cannot continue". I altered the Shockwave.ini file to get the full out put and it only says "Error: -2147219502 ". If I click "Yes" to continue, it goes for a bit and then gives me an "Object expected" error. I placed alert() commands in my code until I narrowed down the problem line:

      txtr = pSprite.member.newTexture("myTexture1", #fromImageObject, member("myImage").image)

      Any ideas why this would work in Director and in a Projector, but not in Shockwave
        • 1. Re: newTexture errors?!
          Ex Malterra Level 1
          Assuming member("myImage") is a bitmap the .image part of the final argument is extraneous. Try txtr = pSprite.member.newTexture("myTexture1", #fromImageObject, member("myImage")).
          • 2. Re: newTexture errors?!
            Newt99 Level 1

            If the texture type were #fromCastMember, then .image would be extraneous. But as it is of type #fromImageObject, it is not.

            This error looks like a texture creation of the same name as an existing texture.

            My 2 cents.
            • 3. Re: newTexture errors?!
              Ex Malterra Level 1
              quote:

              Originally posted by: Newt99

              If the texture type were #fromCastMember, then .image would be extraneous. But as it is of type #fromImageObject, it is not.




              d'oh! i didn't look close enough, thout it was #fromCaseMember.

              • 4. Re: newTexture errors?!
                Newt99 Level 1
                That's what I thought you thought ;-)
                • 5. Re: newTexture errors?!
                  tedalde2 Level 2
                  Perhaps the bitmap and 3D members are not loaded yet. Does the 3D member have a .state of 4, and are you sure the bitmap member is loaded?
                  • 6. Re: newTexture errors?!
                    Ex Malterra Level 1
                    quote:

                    Originally posted by: tedalde2
                    Perhaps the bitmap and 3D members are not loaded yet. Does the 3D member have a .state of 4, and are you sure the bitmap member is loaded?

                    good advice. you also might want to resetWorld(). lingo something like:

                    on enterFrame(me)
                    if member("w3d").state <> 4 then
                    _movie.go(movie.frame)
                    else
                    member("w3d").resetWorld()
                    end if
                    end enterFrame

                    crud i can't remember the lingo "not equal to" opertator. did i get it right? in javascript syntax i use

                    (member("w3d").state != 4) ? _movie.go(_movie.frame) : member("w3d").resetWorld();

                    • 7. newTexture errors?!
                      extol Level 1
                      Wow. Thanks for the help guys. II didn't check for a state = 4, but I do have a frame where it checks every member of my cast to see it mediaReady = TRUE before continuing on in the movie. Then a call to resetWorld() is made. Does that accomplish the same thing you guys are talking about?

                      EDIT: I checked the state of my (only) 3D member and it was at 0. So I made it wait until it was at 4 as well as waiting for all my members.mediaReady to be TRUE. Still the same error.

                      The reason I added that check is because before I was actually getting a "media not ready" error. But now it's just the other error. And in my texture creation handler, it checks to see if a texture by the same name already exists and then deletes it if it does. So, I'm not sure what the error could be. Any more insight would be EXTREMELY appreciated.
                      • 8. Re: newTexture errors?!
                        extol Level 1
                        Okay, I'm a moron. Somehow I switched my import settings to "Link to external file" instead of "standard import". So the last 10 or so cast members weren't included in my movie. And since they aren't there for my movie, they are never ready and unavailable for use. I re-imported them with the correct settings and it works fine. To everyone: don't make this same mistake. lol