[FLASH 8]duplicate Movieclip

i’ve got a script of a newspage with php and mySQL
(within flash ofcourse)
This script got 1 dynamic text field.
Now i like to create it different. Every title and body message must be together in 1 MC.

So i think the best is to use the duplicateMovieClip statement.

I found this code in a book of mine and changed it a bit for where i know. But I still have two problems.

FIrst of all:
All the movieclips will be placed at _x. 0 and _y. 0
And for every record (ID) i need to automaticly create a new MC.
I got this code for static adding Mc’s but it must be dynamicly loaded and the second mc must come after the first one.

i got this actionscript so far:

[AS]
depth = 0;
for (copy = 0; copy < 10; copy++)
{
duplicateMovieClip (_root.loadNieuws.nieuwsItem, “nieuws” + copy, depth);
_root.loadNieuws[“nieuws” + copy]._x = 0;
_root.loadNieuws[“nieuws” + copy]._y = “nieuws” + 5;
depth++;
}
[/AS]

this code ofcourse creates 10 Movieclips with the instancename “nieuws0” to “nieuws9”

do i need to place it in an onClipEvent() ?
for now i placed it in the first frame.

The original code i found got a random placement. and ofcourse i changed that.
If someone can help me out, i would be gratefull.
And ofcourse when someone needs more information: i’ll be there.

Already thanks for helping
kind regards Jos

for (copy = 0; copy < 10; copy++){
    var news:MovieClip = duplicateMovieClip (_root.loadNieuws.nieuwsItem, "nieuws" + copy, copy);
    news._x = 0;
    news._y = 20*copy;  // <-- what were you trying to do there? Try something like what i just put there.
}
for (copy = 0; copy < 10; copy++){
    var news:MovieClip = duplicateMovieClip (_root.loadNieuws.nieuwsItem, "nieuws" + copy, copy);
    news._x = 0;
    news._y = 20*copy;  // <-- what were you trying to do there? Try something like what i just put there.
}

thanx,

i’ll try this code. this code creates 10 movieclips. Does someone knows how i can add some code to communicate with mySQL to add the amount of records instead of a given number?

you need to get a total in php then pass it as a variable to flash, for use in place of the “10” thats there right now.

Post your php file and i’ll see if i can modify it for ya

thanks for all the time you take for me.
All the scripts and the main flashfile (so you can see how it’s build) are together at

http://www.dri360.com/news.zip

the main php file is: “maak_nieuws_berichten.php” this is the file wich is loading within the flashfile.

For questions you can write a post or email me at jos@it-bone.nl

ind regards Jos