6 Replies Latest reply on May 30, 2008 8:49 AM by ShaunC08

    Replace a sprite?

    ShaunC08
      In my cast I have a large number of sprites. I would like to import a new sprite, trim the white space and have it replace another sprite without anything being deleted from the score. Rather annoyingly I can't find a way to do this.

      Thank you.
        • 1. Re: Replace a sprite?
          Level 7
          ShaunC08 wrote:
          > In my cast I have a large number of sprites. I would like to import a
          > new sprite, trim the white space and have it replace another sprite
          > without anything being deleted from the score. Rather annoyingly I
          > can't find a way to do this.

          ITYM "member", not "sprite", in which case you're looking for
          member(x).filename

          Andrew


          • 2. Replace a sprite?
            ShaunC08 Level 1
            Yes, I've just realised the mistake I made. From now on I will use the term "member". However, I don't understand what you said afterwards. Could you elaborate? If you look at this screenshot...

            http://img58.imageshack.us/img58/6418/directordumpok7.png

            I simply want to replace "Image_Sightseeing" (as well as Image_SightseeingH which isn't visible there) with a new imported image without the the link between what's on the score and the member being removed, if that makes any sense...
            • 3. Re: Replace a sprite?
              Level 7
              ShaunC08 wrote:
              > Yes, I've just realised the mistake I made. From now on I will use
              > the term "member". However, I don't understand what you said
              > afterwards. Could you elaborate? If you look at this screenshot...
              >
              > http://img58.imageshack.us/img58/6418/directordumpok7.png
              >
              > I simply want to replace "Image_Sightseeing" (as well as
              > Image_SightseeingH which isn't visible there) with a new imported
              > image without the member that's linked to on the cast being removed,
              > if that makes sense...

              In that case, you want to use something like

              z=new(#bitmap, castLib("imports"))
              z.fileName=yourNewFile
              sprite(x).member=z

              I recommend using a separate castLib for things like that ("imports" in that
              example), to avoid potentially messing up what you already have.

              And if you're doing that at run-time in a Shockwave movie, the loading will
              happen asynchronously, so a different technique is needed.

              Andrew


              • 4. Re: Replace a sprite?
                ShaunC08 Level 1
                I appreciate your time, but I did not think such a simple process would have to be done using lingo. I have only been using Director for a few weeks, and have therefore not been able to adapt to lingo so much. Thank you for your explanation, but I don't quite understand it.

                Why doesn't Director have such a simple feature by default?
                • 5. Re: Replace a sprite?
                  Level 7
                  ShaunC08 wrote:
                  > I appreciate your time, but I did not think such a simple process
                  > would have to be done using lingo. I have only been using Director
                  > for a few weeks, and have therefore not been able to adapt to lingo
                  > so much. Thank you for your explanation, but I don't quite understand
                  > it.
                  >
                  > Why doesn't Director have such a simple feature by default?

                  Aha! It does help to find how much experience you have...: import the new
                  cast member, select the sprite on stage and press Ctrl+e

                  Andrew


                  • 6. Re: Replace a sprite?
                    ShaunC08 Level 1
                    Sorry for not making that clear earlier. Thanks for your solution. It works perfectly. :)