6 Replies Latest reply on Jul 27, 2006 4:07 PM by toby1brace

    animating MIAWs

    Opera Rat
      At one point in my movie a MIAW opens in the center of the screen. I do this with:

      on exitFrame me
      window().new("flower").open()
      w = window "flower"
      d= (the deskTopRectList)[1]
      w.rect = rect(d.left + 198, d.top + 190, d.left + w.rect.width + 198, w.rect.height + d.top + 190)

      end

      At another point in the movie I would like that MIAW to movie up to:
      on exitFrame me
      w = window "flower"
      d= (the deskTopRectList)[1]
      w.rect = rect(d.left + 198, d.top + 80, d.left + w.rect.width + 198, w.rect.height + d.top + 80)

      end

      I don't just want it to jump there. I would like it to reposition itself smoothly. Is this even possible or am I dreaming?
        • 1. Re: animating MIAWs
          Level 7
          You could use a timeout object, or just a frame-event-trapping script to
          move your window up:
          --
          on exitFrame me
          if window("flower").rect.top > 80 then
          window("flower").rect = window("flower").rect - [0, 1, 0, 1]
          end if
          end
          • 2. Re: animating MIAWs
            Opera Rat Level 1
            I don't know how to use a timeout object and I can't find any information on a frame-event-trapping script. But I tried your code in a frame and when I played back the movie I got a script error.
            • 3. Re: animating MIAWs
              Level 7
              Opera Rat wrote:
              > I don't know how to use a timeout object and I can't find any
              > information on a frame-event-trapping script. But I tried your code
              > in a frame and when I played back the movie I got a script error.

              For this line
              window("flower").rect = window("flower").rect - [0, 1, 0, 1]

              try
              window("flower").rect = window("flower").rect - rect(0, 1, 0, 1)

              Andrew


              • 4. Re: animating MIAWs
                Level 7
                >>I don't know how to use a timeout object and I can't find any
                >>information on a frame-event-trapping script. But I tried your code
                >>in a frame and when I played back the movie I got a script error.
                >
                >
                > For this line
                > window("flower").rect = window("flower").rect - [0, 1, 0, 1]
                >
                > try
                > window("flower").rect = window("flower").rect - rect(0, 1, 0, 1)

                I tested that line before posting it and it doesn't provoke a script
                error. A rect, like a point, can safely be treated as an implementation
                of a list (whereas a #date or #color, for example, /can't/ be treated as
                a list)
                Without details supplied about the error text it's difficult to say
                exactly what's going wrong, but it's possible the window doesn't exist
                when the handler is run.
                • 5. Re: animating MIAWs
                  Opera Rat Level 1
                  That works better. I put this script in a script frame:

                  on exitFrame me
                  if window("fugueNew1").rect.top > 80 then
                  window("fugueNew1").rect = window("fugueNew1").rect - rect(0, 1, 0, 1)
                  end if
                  end

                  and I didn't get an error. But the movie didn't go anywhere either. How is it supposed to move up smoothly if this script just sits in one frame?
                  • 6. Re: animating MIAWs
                    toby1brace
                    Why don't you put a sprite in that frame ( off stage ) and use it to store the properties of
                    vertical and horizontal. Then you can start with 'on begin sprite' and set them to whatever
                    you want, then on exit frame, the sprite can set the rect of the MIAW until it reaches the desired
                    location, usinf whatever increments you like.
                    That's how I do it anyway.