From: dips045 on
Thanks for that, but correct me if I'm wrong, this coding puts the images into
a list; not onto the stage.
Thing is everytime an image is saved, it gets saved into a new member; and
has the same name each time.

Is there a way I can use lingo to put these members onto the stage? As I
mentioned above, so the images can be viewed as a gallery?

Many Thanks

From: Chunick on
[q]Is there a way I can use lingo to put these members onto the stage? As I
mentioned above, so the images can be viewed as a gallery?[/q]
You don't need to make it dynamic for a gallery... unless you're producing
something inordinately complicated... for a regular gallery just put the
sprites on the stage in the format you want the gallery to display, ie.
1. create a placeholder bitmap image in your favourite image editing program
(such as Photoshop) for the gallery images that will show on stage.
2. drag and drop the placeholder onto the stage for each image in your
galltery and place them in position on the stage where they will be for your
gallery layout... for example, 4 rows by 5 columns of the placeholder bitmap.
3. When you want to display the image in place of the sprite on the stage just
switch out the member that the sprite is referencing... remember, sprites are
instances of your member assets, ie:
sprite(x).member = member("some image")
where x is the sprite number (or name if using MX2004 and naming sprites)
"some image" is some member image that you already might have in a cast or you
might have imported during runtime.

... and that's about it. If you need further examples I might have the time to
throw a simple demo together that you can download. Let me know.

From: dips045 on
Hello Chunick, thanks for that, I understand what you've suggested there.

The application I'm creating will allow people to make up their own images
using different icons and logo that will be available in a gallery. Each time
the user clicks save, a screen shot is taken of what the user has created and
is then saved into cast members.

I need a way in which to show each of these pictures saved in cast members to
be shown in a gallery. Will I be able to do that by using a
placeholder?..since there isn't a limit to how pictures will be saved into cast
members.
Many thanks for all your help.

From: Mike Blaustein on
Yes that can be done with a single placeholder. The best thing would be
for you to save these screenshots into an otherwise empty cast. Then it
is easy to recurse through the content of that cast and show the
screenshots in order (or out of order if you choose).

I have no idea how your program is architected, but let's say you have a
cast named "screens" full of these screenshots. You go to a frame that
has just a correctly-sized bitmap sprite, you can make it display the
images in order when you click on it like this...give it this script:

-------start-----
property pImages, pCurrent
on beginSprite me
pCurrent=1

--get the image names
pImages=[]
repeat with iImage=1 to castlib("screens").member.count
pImages.append(castlib("screens").member[iImage])
end repeat

--show the 1st image
sprite(me.spriteNum).member=pImages[1]
end

on mouseUp me
--increment the counter
pCurrent=pCurrent+1
if pCurrent>pImages.count then pCurrent=1

--show the next image
sprite(me.spriteNum).member=pImages[pCurrent]
end
------end------

You can adjust the code to taste and make it so you have a next and
previous button to click on instead of the image itself, or whatever you
want. But this should get you started.

-Mike
From: dips045 on
Thanks Mike, that helped a lot; learnt something new.

Thanks again