2 Replies Latest reply on Jul 31, 2008 12:00 PM by Norman06

    efficient use of sprites

    Norman06
      Hi,

      We made a products cdrom for a client using Director.
      There's a product list. Each product has the following cast members:
      1) an arrow pointing at the product name
      2) product name
      3) a line under the product
      4) link to pdf 1
      5) link to pdf 2

      Each cast member is used in its own sprite. So when there's 60 products, 300 sprites are used
      There's an artificial scrollbar. It changes the location of the sprites when you click on it.

      I recently had to add the 5th column (pdf2). Sprites 200 to 500 were reserved for the products.
      There were 64 products. The scrollbar started to act up. I figured out that I ran out of sprites because 64 products needs 320 sprites.
      I changed the reserved range. For now it's ok, but I'm not happy that so many sprites are used. What if there will be more products and/or more columns? Note: I do realise that you don't want to scroll through hundreds of products.

      I already know that:
      1) Director has a max. of 1000 sprites
      2) You can't put more than 1 cast member in a sprite
      3) You can't assign multiple locations to a sprite, right?

      For instance, I'd rather put the 'arrow' cast member in just one sprite and reuse that sprite on multiple locations.

      are there any others options I missed? Should I perhaps use some other program?
        • 1. Re: efficient use of sprites
          Level 7
          So if I understand correctly, you have more products than can be
          displayed on the stage at any given time. So you have a scroll bar the
          shifts the location of the sprites, i.e. some sprites slide off of the
          stage and make room for others that slide on. At any given time there
          are a certain number of products always on the visible part of the
          stage. Is this a correct description?

          There are many ways to do things in Director. As a matter of fact you
          could build your application and not have a single thing on the score,
          it could be completely blank! Using imaging Lingo you could create your
          entire stage image at any given moment based on the position of the
          scrollbar.

          I am not suggesting you build it this way. It's sort of the opposite of
          the way you have built your application. I only mention this to
          illustrate that the limitation is not Director's rather it is the design.

          An easier method (meaning it requires less complicated coding) is to use
          a set number of sprites on the stage as 'placeholders'. For example,
          let's say you decide to allow for 4 rows of products, each with 5
          columns (arrow, name, line, pdf1, pdf2). A total of 20 sprites, which
          would not change regardless of how many products you include.

          Based on the position of the scrollbar, you would substitute the sprites
          member property (i.e. which cast member is assigned to the sprite).
          Nothing would be moving. You could make the products move up/down one
          row at a time (and then off the screen) or scroll by 'pages'.

          It's not obvious to me the purpose of the underlines and arrows. Can you
          elaborate on this?

          Have I missed the mark altogether?
          • 2. Re: efficient use of sprites
            Norman06 Level 1
            Hi Dave, thanks for responding.
            quote:

            Originally posted by: Newsgroup User
            So if I understand correctly, you have more products than can be
            displayed on the stage at any given time. So you have a scroll bar the
            shifts the location of the sprites, i.e. some sprites slide off of the
            stage and make room for others that slide on. At any given time there
            are a certain number of products always on the visible part of the
            stage. Is this a correct description?

            That is entirely correct!

            quote:

            There are many ways to do things in Director. As a matter of fact you
            could build your application and not have a single thing on the score,
            it could be completely blank! Using imaging Lingo you could create your
            entire stage image at any given moment based on the position of the
            scrollbar.

            I am not suggesting you build it this way. It's sort of the opposite of
            the way you have built your application. I only mention this to
            illustrate that the limitation is not Director's rather it is the design.

            An easier method (meaning it requires less complicated coding) is to use
            a set number of sprites on the stage as 'placeholders'. For example,
            let's say you decide to allow for 4 rows of products, each with 5
            columns (arrow, name, line, pdf1, pdf2). A total of 20 sprites, which
            would not change regardless of how many products you include.

            Based on the position of the scrollbar, you would substitute the sprites
            member property (i.e. which cast member is assigned to the sprite).
            Nothing would be moving. You could make the products move up/down one
            row at a time (and then off the screen) or scroll by 'pages'.

            That sounds very good. I was already thinking of only creating sprites for the visible products. Your idea shows exactly how to implement such a thing.
            I'm actually not the one who created the app in the first place. Of course I would've done it a lot better. ;-)

            quote:

            It's not obvious to me the purpose of the underlines and arrows. Can you elaborate on this?

            The arrow and line don't have a function at all, just looks. I guess the graphics guy was inspired. ;-)

            As a matter of practice, I'm gonna do a test with this new approach. Thanks!