# Passing movies onRelease

**URL:** https://forum.kirupa.com/t/passing-movies-onrelease/113328
**Category:** Uncategorized
**Created:** [June 16, 2004, 11:32pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328 "2004-06-16T23:32:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![eze](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@eze](https://forum.kirupa.com/u/eze)
#### Post date: [June 16, 2004, 11:32pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328/1 "2004-06-16T23:32:27Z")

</div>

hey im using the following code for my main four buttons -

```auto

button_array = ["home","plans","terms","contact"];
for (var i in button_array){
this[button_array*].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
	_root.fromName = button_array*+"_mc";
};
}

```

but every button restarts the home\_mc clip…

i call it like this in the content\_mc clip -

```auto

stop();
attachMovie(_root.fromName, _root.fromName, 1);

```

it also gets removed due to a slide down menu refresh everytime a button is pressed.

SO i have no idea whats going on 😑

---

<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: [June 16, 2004, 11:40pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328/2 "2004-06-16T23:40:09Z")

</div>

in content\_mc it stops at 35 and attachs the \_root.fromName movie and then when another button is pushed it starts from frame 36 in content\_mc and removes the \_root.fromName clip.

However \_root.fromName = the new clip i want and not the old one.  
So in frame 35 i added -

oldMClip = \_root.fromName;  
attachMovie(\_root.fromName, \_root.fromName, 1);

and in frame 36 when it gets restarted -

removeMovieClip(oldMClip);

\*\*i dont get why this doesnt work 😑

---

<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: [June 16, 2004, 11:44pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328/3 "2004-06-16T23:44:27Z")

</div>

Um . . . attachMovie grabs a movie clip out of your library then you give it a new name and a depth. Are you sure you are using it right?

:hr:

---

<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: [June 16, 2004, 11:50pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328/4 "2004-06-16T23:50:33Z")

</div>

button\_array = [“home”,“plans”,“terms”,“contact”];  
for (var i in button\_array){  
this[button\_array\*].onRelease = function() {  
\_root.fromName = 0;  
content\_mc.gotoAndPlay(36);  
\*\* \_root.fromName = button\_array\*+"\_mc";\*\*  
};  
}

well does that pass on a correct name for the movie i want,  
i have home\_mc in my libary and just added plans\_mc and when i click the Plans button it still displays the home\_mc clip

---

<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: [June 16, 2004, 11:55pm UTC](https://forum.kirupa.com/t/passing-movies-onrelease/113328/5 "2004-06-16T23:55:24Z")

</div>

ah i thanks for ya help its coz my movie wasnt exported for actionscript
