# Controlling an \*attachedMovie\*?

**URL:** <https://forum.kirupa.com/t/controlling-an-attachedmovie/26407>\
**Category:** flash\
**Created:** [July 22, 2003, 7:25pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407 "2003-07-22T19:25:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![earph](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/earph/32/79_2.png) [@earph](https://forum.kirupa.com/u/earph)\
**Post date:** [July 22, 2003, 7:25pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/1 "2003-07-22T19:25:26Z")

</div>

Is it possible to control a MC that is attached to another MC?

## Example:

on (release) {

```
_root.loader.play();

```

## }

_loader_ is the blank MC… and I want to control the MC that is attached to it called _movie1_.

Is that possible? Why is it not working?

Thanks ahead of time.

---

<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:** [July 22, 2003, 7:42pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/2 "2003-07-22T19:42:44Z")

</div>

of course, you can control the attached movie with its instance name that u give…  
if your code is  
[AS] loader.attachMovie(“mc1”,“movie1”,1); [/AS]  
you can control it with;  
[AS] \_root.loader.movie1 [/AS]

e.s.x.s

---

<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:** [July 22, 2003, 7:51pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/3 "2003-07-22T19:51:40Z")

</div>

you can also use this method, which is my personal favorite:

```auto
mc = attachMovie("clip", "clip", 0);

```

Now you can control “mc” as “clip”. e.g.:

```auto
mc._xscale = 50;

```

---

<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:** [July 22, 2003, 8:34pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/4 "2003-07-22T20:34:00Z")

</div>

Thanks… e.s.x.s

The code worked just fine, and I got my MC controlled… The only problem is that the movie that is being _attached_ will change a lot and I cant control straight to it.

Know what I mean?

Where you said: _\_root.loader.movie1_

Depending on what button you push, it might be _movie2_, _movie3_, and so on.

So, I can exactly tell my button to control _movie1_ when some other movie was loaded into it.

Does that make sense?

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:** [July 23, 2003, 8:17am UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/5 "2003-07-23T08:17:15Z")

</div>

i can’t understand well…but my answer is:  
if you attached the “movie1” ,add your code:  
[AS]  
\_root.myAttachedMovie = “movie1”;  
[/AS]  
and add below code to your buttons:  
[AS]  
on(release){  
if(\_root.myAttachedMovie == “movie1”){  
//what you want to do  
}  
if(\_root.myAttachedMovie == “movie2”){  
//what you want to do  
}  
if(\_root.myAttachedMovie == “movie3”){  
//what you want to do  
}  
}  
[/AS]

---

<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:** [July 23, 2003, 2:45pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/6 "2003-07-23T14:45:59Z")

</div>

Thanks! I also found another way… see below.

## BUTTON:

\_root.loader.thePath.play()

## FIRST FRAME OF MOVIE THAT WAS ATTACHED

\_parent.thePath = this

Thanks for all the help… I appreciate 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:** [July 23, 2003, 2:54pm UTC](https://forum.kirupa.com/t/controlling-an-attachedmovie/26407/7 "2003-07-23T14:54:18Z")

</div>

u r welcome skillet:) i couldn’t understand right, what u mean;) but now i understood:)

e.s.x.s
