I have a product catalogue that, thanks to help from this
forum, now trawls specified directories and loads images into a
specific cast library. I then assign these cast members to sprites
placed within my 'display' area - a 3 x 3 grid. Forward and back
buttons browse through all the items in a directory and a 'Next'
button moves onto the next directory, reloading the cast library
The problem I have is that the images are all sizes and
shapes so on assigning the member to the sprite I have to resize it
(there are issues with aspect ratio but they'll be resolved in the
images themselves). This, I thought, would be a doddle and it is,
for the first directory. The first directory works perfectly. The
first nine are loaded and appear on screen in the grid, all the
right size and shape, as do all the others in that directory over
However, when I load the next directory the images are loaded
using the same script BUT they seem to 'ignore' the lingo to resize
them. I've tried using .left, .top, etc. and .locH, .locV with
.width and .height. Both methods work for the first directory but
not the subsequent ones.
It's driving me mad because I'm stepping through the code and
the commands are being carried out but apparently just ignored. I
step through sprite(numSp).left = 100 and it just sits there at
181, for example.
Is there some basic process I'm missing? Is there a reliable
process for assigning members to sprites and forcing them to use
the sprite dimensions/locations?
Try this script by our very own Dave Mennenoh. It will
rescale a cast
member to whatever size you desire, maintaining the aspect
it rescales the member, not the sprite, it has the added
bonus of making
your cast library a much smaller file:
Thanks, that looks useful and will probably make it into the
The problem I've got right now is sprites 'ignoring' the locH
and locV settings. I'm stepping through the script, I got through
the lines that set them and the sprite just sits there ignoring it.
I've punted in some updateStage() lines to watch the motion, I'm
certain it's the right sprite, it's just not moving. It must be
something obvious but it really is driving me mad.