# Using duplicate and attach movie to create background

**URL:** <https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544>\
**Category:** Uncategorized\
**Created:** [September 27, 2004, 3:39pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544 "2004-09-27T15:39:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamidb4](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@hamidb4](https://forum.kirupa.com/u/hamidb4)\
**Post date:** [September 27, 2004, 3:39pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/1 "2004-09-27T15:39:00Z")

</div>

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. 😊

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 6:01pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/2 "2004-09-27T18:01:24Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 6:15pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/3 "2004-09-27T18:15:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 6:35pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/4 "2004-09-27T18:35:30Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 6:46pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/5 "2004-09-27T18:46:03Z")

</div>

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).  
 ![](http://members.cox.net/hamidb4/Untitled-2.jpg)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 7:01pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/6 "2004-09-27T19:01:08Z")

</div>

like this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 7:20pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/7 "2004-09-27T19:20:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 7:34pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/8 "2004-09-27T19:34:06Z")

</div>

> [@hamidb4](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 7:56pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/9 "2004-09-27T19:56:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 8:19pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/10 "2004-09-27T20:19:52Z")

</div>

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:

```auto
_root.setBackground(*instanceName*);

```

hope this helps

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 1:59pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/11 "2004-09-28T13:59:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 4:49pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/12 "2004-09-28T16:49:41Z")

</div>

just like this 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 4:50pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/13 "2004-09-28T16:50:38Z")

</div>

lol, forgot to attacth it. here it is:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 5:05pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/14 "2004-09-28T17:05:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 5:21pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/15 "2004-09-28T17:21:15Z")

</div>

> [@hamidb4](#):
>
> BEAUTIFUL  
> Thank you. meghsi. shokran. mamnoon, and however you say it in your native language.

aww… 😃  
It’d just be thank you, lol 😛

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 5:21pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/16 "2004-09-28T17:21:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 5:28pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/17 "2004-09-28T17:28:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 10:04pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/18 "2004-09-28T22:04:21Z")

</div>

😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 4:44pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/19 "2004-09-30T16:44:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 4:53pm UTC](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544/20 "2004-09-30T16:53:04Z")

</div>

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.

[Next page](https://forum.kirupa.com/t/using-duplicate-and-attach-movie-to-create-background/65544.md?page=2)
