4 Replies Latest reply on Aug 15, 2006 7:02 AM by Newsgroup_User

    When do Sprite Properties Reset?

    BSpero Level 1
      Ok,
      I am not sure why I have never had this problem before, but I feel like a fool at the moment and perhaps it's just because I have been working too long. I have a sprite, (actually 10 or them) that I want the user to be able to move around the stage. They can leave that screen and move to another part of my movie, but when they return, I would like all the sprites to be back where they started, not where the user moved them to. I have a property being set in the sprite about its original location that is instigated at beginSprite, but this is reset each time the sprite starts of course. When I go to a frame of the movie where the sprites don't exist, and then go back, they are not resetting how I would like them to. Is there any way to reset the sprites to their original locations easily?

      - Bruce
        • 1. Re: When do Sprite Properties Reset?
          Level 7
          If the sprite span does not continue into these other parts of your movie,
          they should reset on their own. The only way I know this wouldn't happen is
          if you're manually puppeting those channels. Are you setting the puppet of
          those sprites to TRUE?

          --
          Craig Wollman
          Word of Mouth Productions

          phone 212 928 9581
          fax 212 928 9582
          159-00 Riverside Drive West #5H-70
          NY, NY 10032
          www.wordofmouthpros.com


          "BSpero" <webforumsuser@macromedia.com> wrote in message
          news:ebr4u7$3ku$1@forums.macromedia.com...
          > Ok,
          > I am not sure why I have never had this problem before, but I feel like
          > a
          > fool at the moment and perhaps it's just because I have been working too
          > long.
          > I have a sprite, (actually 10 or them) that I want the user to be able to
          > move
          > around the stage. They can leave that screen and move to another part of
          > my
          > movie, but when they return, I would like all the sprites to be back where
          > they
          > started, not where the user moved them to. I have a property being set in
          > the
          > sprite about its original location that is instigated at beginSprite, but
          > this
          > is reset each time the sprite starts of course. When I go to a frame of
          > the
          > movie where the sprites don't exist, and then go back, they are not
          > resetting
          > how I would like them to. Is there any way to reset the sprites to their
          > original locations easily?
          >
          > - Bruce
          >


          • 2. Re: When do Sprite Properties Reset?
            BSpero Level 1
            Craig,
            I am not. I just tried a simple movie where I put a red ball that I quickly made with the vector tool. I set the moveable to true, and when I play the movie I can move it around the screen. If I leave the frame where the ball exists, and then go back to it, the ball is in the location that I left it at, so it doesn't reset. I solved my problem by setting a property at beginSprite, and then moving it back to this location on endSprite, but I am still wondering why I have never had this issue before, and why it is just coming up now. Perhaps the puppetSprite is automatically set to TRUE when you make the sprite moveable? Oh well...

            - B
            • 3. Re: When do Sprite Properties Reset?
              Level 7
              If you use the moveable property to allow a sprite to be moved on the
              stage, then it's loc will be whereever it has been moved to. If you
              leave the extent of that sprite and return, the sprite will be where it
              was moved to.

              If you use Lingo to allow a sprite to be moved on the stage, say using
              the Draggable Behavior in the Library, then that sprite will return to
              it's starting loc, when you return to a frame where the sprite exists.

              Using Lingo to change sprite properties is temporary. The change only
              lasts during the extent of the sprite. However, if you set the
              moveableSprite property using Lingo, and turn it on in a beginSprite
              funciton and off in an endSprite function, the sprite will return to
              it's original loc when you leave the extent of that sprite.

              --
              Rob
              _______
              Rob Dillon
              Adobe Community Expert
              http://www.ddg-designs.com
              412-243-9119

              http://www.macromedia.com/software/trial/
              • 4. Re: When do Sprite Properties Reset?
                Level 7
                Given that, you have the option that Rob mentions-using Lingo-or you could
                maintain the original location of the sprite in a global and use that in
                your beginSprite to reset the sprite to it's original location.

                Even this will work

                global gOrigLoc

                on beginSprite me
                if gOrigLoc.voidP = TRUE then
                gOrigLoc = sprite (me.spriteNum).loc
                end it
                sprite (me.spriteNum).loc = gOrigLoc
                end

                in authoring gOrigLoc will maintain it's value while your movie is stopped.
                But this is ok since it will only be loaded with the sprite's loc the first
                time you play the movie or projector (although with a projector you can't
                start/stop it while it's open like you can in authoring)

                --
                Craig Wollman
                Word of Mouth Productions

                phone 212 928 9581
                fax 212 928 9582
                159-00 Riverside Drive West #5H-70
                NY, NY 10032
                www.wordofmouthpros.com


                "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
                message news:rob-190492.07545615082006@forums.macromedia.com...
                > If you use the moveable property to allow a sprite to be moved on the
                > stage, then it's loc will be whereever it has been moved to. If you
                > leave the extent of that sprite and return, the sprite will be where it
                > was moved to.
                >
                > If you use Lingo to allow a sprite to be moved on the stage, say using
                > the Draggable Behavior in the Library, then that sprite will return to
                > it's starting loc, when you return to a frame where the sprite exists.
                >
                > Using Lingo to change sprite properties is temporary. The change only
                > lasts during the extent of the sprite. However, if you set the
                > moveableSprite property using Lingo, and turn it on in a beginSprite
                > funciton and off in an endSprite function, the sprite will return to
                > it's original loc when you leave the extent of that sprite.
                >
                > --
                > Rob
                > _______
                > Rob Dillon
                > Adobe Community Expert
                > http://www.ddg-designs.com
                > 412-243-9119
                >
                > http://www.macromedia.com/software/trial/