Creating buttons dynamically

I want to make a site for my personal gallery and i’m asking you if there is another method to make my gallery, other that the one when the user click Back and Next to navigate through thhe images in the order that i chose.

I want to create some buttons dynamically (so i will be able to add images to the gallery without replacing the SWF) and assign each of these buttons an on(release) or on(press) event handler that will show the image for that button.

Can this be done with Action Script? If yes…how?

PS: Sorry my bad english…

Surely it can be done :slight_smile:
If you havent tried anything like it before, it might be a bit complicated. I would recomend you use xml - unless you have prevous experience with some serverside scritpting, php/asp?

do you know a link fora tutorial from where i can see the idea? i don’t know php and i thought i could make it all with AS

Well, at kirupa.com theres a lot on xml, and it’s some great stuff!
If you want to avoid making a new swf, everytime you upload new pics for your gallery, you will have to somehow tell flash wich pics to show - that’s where i would use an xml doc - if there is a lot of pics, maybe just a little asp(!). But dont worry, its really not that complicated :slight_smile:

Here’s the xml/flash tutes at kirupa:
http://www.kirupa.com/web/xml/index.htm

Your images would have to have some kinda id per image. For example using image1.jpg then image2.jpg and so on and so forth. This is so you can navigate through them without the use of an array or some PHP pulling the names from a DIR.

Once you have that down you use attachMovie in a for loop run as many times as your image count. You can even create dynamic labels this way, just without the attachMovie part.

What is your skill level in Actionscript would you say? Because this would be rather hard if you didn’t know what your doing.