That's certainly one route to take. It's not the most dynamic or flexible, as you well know. I suggest that you create these movieclips via ActionScript. Since they're empty movieclips you will want to use the createEmptyMovieClip() method not the duplicateMovieClip method.Quote:
I have created 60 movieclips in the stage. They have instance names given of image1, image2, image3, image4, etc. The last one in series is image60.
It certainly works and I do use it in some instances. Technically it was deprecated after Flash 5 & AS1, but it will still work. The official way is to do it with arrays, but I find arrays to be a little cumbersome in some instances. If you're going to do the rest of setup with the same logic as you currently have, eval will work fine for you. Otherwise, switch to an array.Quote:
I borrowed eval from one of your earlier posts. Is that the correct technique?
That's because you're starting your loop at i=1 and then setting the _x property with i*100. So the first one will have a _x property of 100. You'll want to start the loop at 0, so that the first value will equal 0.Quote:
The first image starts 100 pixels from the left hand edge. I would like to make it flushed against it.
Also, instead of doing all of those if statements, you can declare a variable that keeps track of how many items you've added to the stage. When you reach the limit, reset the variable and increment the _y variable by 100.
Here is an example of how it is done. It's a full browser width application. If you resize the browser and refresh, it will automatically calculate how many images to add to each row. When you test it locally (the source is included on the page, as always) it looks a little better because the images load more organically. When I just tested it online, the images load sequentially, which is not what I wanted. If I were deploying this I'd change that. But, alas, I'm not.Quote:
I research createDuplicateMovieClip but I cannot make it work. How do I make it so that I can use any amount of clips, not just 60. How can I make it so that I do not have to create 60 image cliops.
It's random so when you refresh, images will switch. I also added a fun little mouse over effect to light/dim the movies. This also proves my point about keeping things simple. The only "animation" I'm doing here is an alpha (transpareny) tween on a black layer that's above each image. It's two/three lines of code but it makes a dramatic impact.
This should get you started. I've commented out the source so you shouldn't have any problems adapting it.
