Using duplicate and attach movie to create background

Hi,
I have a few movieclips in the library that I like to use for background. Another words I like to give user different choices for background. So, there would be some buttons or movieclip buttons on the stage. If the user clicks a buton, one of the symbols in the library gets duplicated so many times(depending on its width and hight and what it takes to fill the background), and then by the use of attachmovie it is set on the stage.
Examples of library symbols: a 45 degree line, a custom made strip, or anything else.
I am assuming this does not effect the file size too much. A simple file would do wonders for me as it has been a long learning process.
Thanks alot. :blush:

you could just use loadMovie to put an external movieclip into the background, and then resize the background so that if fits ok.

hope this helps :slight_smile:

Yes, but if I could do it my way, there are all kinds of variations that can be made in no time at all. Mainly I was interested in learning to materialize this concept that I had.

you’d just clear the contents of the movieclip for the background, and then attach all of the new ones. for example, to clear the background movieclip, you might have code like this:

for (i in _root.background) { //where _root.background is the name of your movieclip that the background is going in.
  _root.background*.removeMovieClip();
}

to attach all of the movieclips… hm… i’ll just have a quick look at that and post back soon

If I’m not clear about what I’m trying to do, here is a visual look at how the background looks like(asuming a 45 degree line symbol in the library).

like this?

cyberathlete,
You got it. That’s exactly what I wanted.
Apart from the learning issue, is it a crazy idea?
appreciate your help.

what learning issue. you want me to explain it?

Sorry, wify needed the computer for a little while.
Nevermind the learning part. Let me rephraze the question though.
Is it crazy to get defferent backgrounds like this(the way I approached it in this thread)?
Thanks again.

you mean use different images to tile across the back? if so - not at all. i made it so that all you need to do is create your movieclip with your image in it, and then export it for actionscript use with an instance name. then, when you want to make that image tiled across the background, just call:

_root.setBackground(*instanceName*);

hope this helps

cyberathlete,
You did a wonderful job. Misson accomplished.
How do you go about doing this with a different set up. Suppose you had x number of movieclip symbols in the library. you wanted to use just one button to set the background.
So, each time you click on the button, you set a different background. The advantage of having this set up is that you don’t need a new button for each new movieclip symbol in the library.
Thanks.

just like this :smiley:

lol, forgot to attacth it. here it is:

BEAUTIFUL
Thank you. meghsi. shokran. mamnoon, and however you say it in your native language.

aww… :smiley:
It’d just be thank you, lol :stuck_out_tongue:

happy to help - it’s a decent excuse for not doing homework :smiley:

you can tell i’m happy from the overuse of smilies!!

My bad,
Location: Perth, Scotland gave me the impression that you are from there.

:wink:

hi cyberathlete, Neat fla. It works great on its own but when i want to put it on my fla that has buttons and empty movieclips being loaded the buttons doesn’t work anymore to launch the bg. do i need to remove the _root. on every AS. also how do i show one of the background at the starting without have to press a button

thanks

have you put the function in frame1 into your fla?
if you don’t get this working, upload the fla and i’ll have a look for you.