This content has been marked as final. Show 4 replies
If I'm understanding correctly what you're trying to do, I'd say you need to use mask(s) to accomplish the task. See if the following link helps you:
No, I doubt it's that complicated. Worst case scenario, some of the examples I've been looking at seem to suggest you can do it using Bitmap objects and the scroll() function, but I was hoping there was an even easier way. It's such a basic thing in game programming (animated sprites all work that way... the image is like an animation strip), but I guess Flex isn't really designed for game programming.
Seems pretty simple:
<mx:Canvas clipContent="true" height="32" width="32">
<mx:Image scaleContent="false" x="-32" y="-32"
To show the 1,1 tile (assuming 0,0 is your start). Just progrtamtically change your x/y as needed, and the canvas will clip the image to 32x32.
Otherwise, you will need to do something like what I did here: http://www.pinktogether.com
which is use bitmap compositing and manipulation. The ribbon image composites something like 5000 images in under a second, and dynamically generates the scroll edges.
Thanks, that's exactly what I needed to know. Somehow in poring over the properties list of the Image component, I failed to find the scaleContent attribute.