8 Replies Latest reply on Aug 27, 2009 9:14 AM by dan_hin

    Best approach for a scrolling stage?

    Applied CD Level 1
      I’ve got a project where the user must be able to place and move factory equipment over a factory floor plan. The factory floor plan is larger than the stage window so it must be scrollable. I started this project assuming the easiest approach would be to put the factory floor and equipment sprites into an MIAW with scroll bars on the stage that offset the MIAW drawRect. I’ve got the prototype working well enough except I can’t seem to find a window type that gives me exactly what I want. #dialog is completely out so my only two choices are #document and #tool (both with the title bars hidden). #document is a problem because clicking on the stage pops it above the MIAW, #tool is a problem because the MIAW is always on top, even on top of other applications … is there a way to define an MIAW that is always on top of the stage but not on top of other application windows if they should be brought to the front?

      Of course another option would be to do away with the MIAW and use a mask on the stage and place the floor plan and equipment sprites below the mask. The scroll bars would then offset the location of the floor and equipment sprites, the user would only see the portion of sprites showing through the mask hole (it would look like a standard document window to the user). Initially I thought this approach would be messy, I liked the idea of having all my object sprites in a window separate from the user interface but as I’m writing this I’m beginning to think this might have been the way to go. Has anyone tried something similar?

      PS: I’ve kind of dismissed the idea of using imaging lingo for the scrollable area … the equipment sprites are dynamic, some are animated, others can be posed by the user, all must be able to be moved, rotated, grouped, ect…
        • 1. Re: Best approach for a scrolling stage?
          Level 7
          You could try using #tool and detect when the stage loses focus and
          move/hide the MIAW. That way it will appear to layer nicely with other
          application windows, but will stay on top of the Director stage window.

          -- in MIAW #movie script:
          on deactivateApplication
          _player.activeWindow.close()
          end

          on activateApplication
          _player.activeWindow.open()
          end
          • 2. Re: Best approach for a scrolling stage?
            Applied CD Level 1
            Thanks Sean, I think I’ll give that a try. I might go one step further and try to get an image of the MIAW before closing to serve as a place holder for the soon to be absent MIAW … otherwise you end up with a big hole where the MIAW used to be.
            • 3. Re: Best approach for a scrolling stage?
              Level 7

              "Applied CD" <webforumsuser@macromedia.com> wrote in message
              news:fm8fjh$g12$1@forums.macromedia.com...
              > I?ve got a project where the user must be able to place and move
              > factory
              > equipment over a factory floor plan. The factory floor plan is
              > larger than the
              > stage window so it must be scrollable. I started this project
              > assuming the
              > easiest approach would be to put the factory floor and equipment
              > sprites into
              > an MIAW with scroll bars on the stage that offset the MIAW drawRect.
              > I?ve got
              > the prototype working well enough except I can?t seem to find a
              > window type
              > that gives me exactly what I want. #dialog is completely out so my
              > only two
              > choices are #document and #tool (both with the title bars hidden).
              > #document is
              > a problem because clicking on the stage pops it above the MIAW,
              > #tool is a
              > problem because the MIAW is always on top, even on top of other
              > applications ?
              > is there a way to define an MIAW that is always on top of the stage
              > but not on
              > top of other application windows if they should be brought to the
              > front?
              >
              > Of course another option would be to do away with the MIAW and use a
              > mask on
              > the stage and place the floor plan and equipment sprites below the
              > mask. The
              > scroll bars would then offset the location of the floor and
              > equipment sprites,
              > the user would only see the portion of sprites showing through the
              > mask hole
              > (it would look like a standard document window to the user).
              > Initially I
              > thought this approach would be messy, I liked the idea of having all
              > my object
              > sprites in a window separate from the user interface but as I?m
              > writing this
              > I?m beginning to think this might have been the way to go. Has
              > anyone tried
              > something similar?
              >
              > PS: I?ve kind of dismissed the idea of using imaging lingo for the
              > scrollable
              > area ? the equipment sprites are dynamic, some are animated, others
              > can be
              > posed by the user, all must be able to be moved, rotated, grouped,
              > ect?
              >

              How about using a linked Director movie instead of a window?
              Just put it on the stage.

              Richard.


              • 4. Re: Best approach for a scrolling stage?
                Applied CD Level 1
                Hi Richard,

                Using an LDM is a very interesting idea, if it works I might be able to make the project Shockwave safe (not a requirement but a nice touch if possible).

                I’ve made a test rig with a cropped LDM and all my factory equipment sprites work but I can’t find a property I can use to scroll the LDM (which is about 3 times the size of the LDM sprite on the stage). For the MIAW I was adding an offset to the drawRect. I thought sprite(“myLDM”).crop(rect) might work but apparently LDM sprites don’t have a crop property. Offsetting the sprite.rect moves the entire sprite as you would expect. Anyone know how to pan over a cropped LDM?
                • 6. Re: Best approach for a scrolling stage?
                  Applied CD Level 1
                  OK, I've had mixed results with Openspark's scroll ... see new thread specifically on scrolling LDM's:

                  http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=11&catid=187&threadid =1329789&enterthread=y
                  • 7. Re: Best approach for a scrolling stage?
                    dan_hin Level 1

                    damn. that penultimate link leads right back to the start of adobe forums. Any chance you could repost?