# Dynamic images from Database

**URL:** https://forum.kirupa.com/t/dynamic-images-from-database/4548
**Category:** flash
**Created:** [August 13, 2002, 5:30am UTC](https://forum.kirupa.com/t/dynamic-images-from-database/4548 "2002-08-13T05:30:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mark7a](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mark7a](https://forum.kirupa.com/u/mark7a)
#### Post date: [August 13, 2002, 5:30am UTC](https://forum.kirupa.com/t/dynamic-images-from-database/4548/1 "2002-08-13T05:30:43Z")

</div>

This is my new project, I have a database contain information about products and there images, I also created a flash file, with 4 scenes:  
1st scene has the product categories on rollover list of sub categories appears and each sub category link to 2nd scene  
2nd scene has the product sub categories and links to 3rd scene  
3rd scene has products displayed horizontally as images and underneath the image the product name, and each product links to 4th scene  
4th scene displays details about selected product from scene # 3.

All the information is driven from a database using ASP and here is a list of the challenges that I got:

1- Scene # 3 loading images into the movie dynamically, I had no problem loading the information as text and display them in a horizontal line, the following is the script that I used:

[COLOR=green]------------------------  
// depth  
depth = -1;  
// hide the original clips which called dynpic  
dynpic.\_visible = 0;  
// split up the array by looking for the commas from the information which loaded in a previous frame through the asp file  
dynpic\_array = collectprodpic.split(",");  
// get the length of the array  
dynpic\_length = dynpic\_array.length;  
// set the start y position (x position depends on where you put it on the screen)  
xposition = 275;  
// looping everything  
for (i=0; i\<dynpic\_length; i++) {  
// duplicate the movie  
duplicateMovieClip(dynpic, “dynpic” add i, depth);  
// set the movie postion  
setProperty(“dynpic” add i, \_y, xposition);  
// loading the image to the movie  
dynpic.loadMovie(dynpic\_array[1],“dynpic”);  
depth–;  
// Set the x position plus 55  
xposition = xposition+55;  
}  
stop();

* * *

[/COLOR]  
of course I know that I have to load all the images first and then display them and that’s one of the things that I’m stock on.  
One other thing when generating those images I need to generate a link associated with that picture so when I click on that picture it passes the id of that product to scene # 4 and then I can take from there by pulling the information from the database and display it again.

Any help, please

Thanks
