5 Replies Latest reply on Dec 20, 2007 6:29 PM by James Newton, ACP

    Animated window mask using imaging lingo…

    Applied CD Level 1
      Has anyone tried animating a window mask at runtime using imaging lingo? Does it work and is it smooth on at least a reasonable cross section of machines? I’m thinking something like the Media Player skins from http://www.theskinsfactory.com/skinsfactory/ (specifically the Alienware Invader skin) … although frankly, even on my brand new duo that skin could animate smoother.
        • 1. Re: Animated window mask using imaging lingo?
          Level 7
          I tried it once and rejected it as performance was too poor. But you
          shouldn't take my word for it ...
          • 2. Re: Animated window mask using imaging lingo?
            Level 7

            "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
            news:fkc5iu$3ji$1@forums.macromedia.com...
            >I tried it once and rejected it as performance was too poor. But you
            >shouldn't take my word for it ...

            Hi Sean,
            I was wondering sometime ago if it was possible too.
            What size window / mask did you use?

            Maybe for small windows its ok?

            Richard.


            • 3. Re: Animated window mask using imaging lingo?
              Level 7
              > I was wondering sometime ago if it was possible too.
              > What size window / mask did you use?

              Sorry Richard, but I don't remember. All that I recall is that I tried
              and rejected the idea.

              > Maybe for small windows its ok?

              Maybe. Again, it's probably better to try for yourself and see
              • 4. Animated window mask using imaging lingo…
                Chunick Level 3
                I tried it as well once... the file can be downloaded here:
                http://www.chunick.com/director/animated_mask.zip

                for fun you might want to check out my window with alpha mask too:
                http://www.chunick.com/director/window_alpha_mask.zip

                * (Long) Note: the scrnXtra function ScreenToImage() that was added by Valentin Schmidt to the scrnXtra (and which is used in the example) has a memory leak in it so don't run the example too long. The function was added to the scrnXtra using the ScreenToFile() function as a quick workaround in the C++ code; so ScreenToFile() could probably be used instead to get the exact same effect without any memory leak. The ScreenToMember() cannot be used as it has a flaw because the TrimWhiteSpace() property of a member is enabled by default and the C++ code does not address this... so any white pixels on the border of the image will be trimmed and there's no way to tell which edge of the image they were trimmed from (AFAIK).
                • 5. Re: Animated window mask using imaging lingo…
                  James Newton, ACP Level 3
                  Here's how I achieved an animated window mask:

                  1) Create a series of 1-bit bitmap images, one for each frame of the animation
                  2) Place the bitmaps in order in your Cast library
                  3) Select all the bitmaps
                  4) Click on a cell in the Score
                  5) Select the menu item Modify | Cast to Time
                  6) Select the new sprite span and right-click or Ctrl-click on it (depending on your platform)
                  7) Select Script... from the contextual menu which appears
                  8) Paste the following handler in place of the default handler in the Script window:

                  on prepareFrame(me)
                  vMember = sprite(me.spriteNum).member
                  (the activeWindow).appearanceOptions.mask = vMember
                  end prepareFrame

                  9) Publish your movie as a projector and run it.