0 Replies Latest reply on Apr 10, 2008 3:06 PM by Applied CD

    LDM’s, moveable sprites, and stage updates

    Applied CD Level 1
      I’m updating a project that allows users to layout factory equipment on a factory floor (2 dimensional, top down view only). The original project had a fixed factory floor space (the stage) and about 20 different item types that could be placed into that space. The new version must have a scrollable floor and over 100 different item types (and up to 300 actual equipment sprites). I figured no problem, I’ll make the factory floor an LDM holding all of the equipment sprites with the behaviors to add, delete, group, move, rotate, etc… while the main stage would have the scrollbars, user interface (tool pallets), etc… The scrolling works great and I thought I was on the right track with the LDM’s until I tried moving a sprite within the LDM. The code below is attached to each equipment sprite and is responsible for movement … I can’t use just a simple moveable sprite because it was possible in the old project to move sprites as a group as well as individually and I’d like to retain that functionality, the global glSelectedList is a list of all the sprite numbers currently selected, member names ending with “.off” are swf’s showing deselected equipment, member names ending in “.on” are swf’s showing the same equipment with a selection highlight. If I open the LDM and play it directly everything works fine, the selected objects track with the mouse until mouseUp … if I play the LDM through the user interface the LDM does not update while the mouse is down, so the sprites stay put until mouseUp, then the sprites all jump to the final location. Anyone know why this is happening? Was LDM a bad choice? I had two other choices for the factory floor, MIAWs (I started this a while ago, I don’t remember why I abandoned MIAWs but I remember the LDM came together faster) or I could assign a block of sprites in the main stage to be equipment sprites and scroll them under a bit bitmap mask to separate factory floor from interface … not very nice compartmentalization of roles and I doubt scrolling the floor will be very smooth (potentially big repeat loop with lots of equipment sprites) but maybe easier code in the long run.