# Button actions on a loadmovie

**URL:** <https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516>\
**Category:** Uncategorized\
**Created:** [April 5, 2006, 5:20pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516 "2006-04-05T17:20:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![azuuh](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@azuuh](https://forum.kirupa.com/u/azuuh)\
**Post date:** [April 5, 2006, 5:20pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/1 "2006-04-05T17:20:32Z")

</div>

so i have a flash movie where i have loaded a different movie wich has buttons inside it, so what kind of gotoandplay actions should i put on the buttons so it uses the command on the flash movie where i have loaded the buttons movie to… ?

did anyone understand what i mean? 😃

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 5, 2006, 5:24pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/2 "2006-04-05T17:24:38Z")

</div>

nope 🙂

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 5, 2006, 5:33pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/3 "2006-04-05T17:33:03Z")

</div>

I understood:),  
you have to use relative targetting, i’ll try to draw you an example:

“main\_mc” |  
-------------L “loaded\_mc” |  
------------------------------L “button1”  
------------------------------L “button2”

to make something happen on the main\_mc by clicking button 2 you’d have to refer to it relatively like this:

```auto
button2.onRelease = function(){
   this._parent._parent.gotoAndPlay("someframe")
}

```

that would tell main\_mc to play “someframe”🙂

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 5, 2006, 5:35pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/4 "2006-04-05T17:35:32Z")

</div>

I understood too but it would be nice to have it clarified to be able to target (no pun intended) the problem. 😉

---

<div class="post-metadata">

**Author:** ![azuuh](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@azuuh](https://forum.kirupa.com/u/azuuh)\
**Post date:** [April 5, 2006, 5:47pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/5 "2006-04-05T17:47:24Z")

</div>

why doesnt it work… i might be so noob that im doing it wrong :x  
i have to put the script in the “main\_mc” first frame and give the button in the loadable mc a instance name of button2 ?

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 5, 2006, 5:57pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/6 "2006-04-05T17:57:23Z")

</div>

can you please describe in detail what you want to do and how your file is set up?

or post your code or your fla

---

<div class="post-metadata">

**Author:** ![azuuh](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@azuuh](https://forum.kirupa.com/u/azuuh)\
**Post date:** [April 5, 2006, 6:14pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/7 "2006-04-05T18:14:16Z")

</div>

okay. so i have a movie called sivu.fla and a nother movie called main.fla  
so in the firt keyframe of the sivu.fla i have the following code: loadMovie(“main.swf”, “lataus”); and it loads the movie “main” into the movie “sivu” and the movie “main” have tree buttons inside it, and id like to get it work so that when you press on “button2” so it would jump in the movie “sivu” to frame 2.

lol i suck doing things clean.  
you understand now? next time ill post the .fla´s 😛

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 5, 2006, 6:18pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/8 "2006-04-05T18:18:51Z")

</div>

If main is getting loaded into sivu then sivu becomes \_root. So all you have to do to get to frame 2 of sivu is

```auto
on(release){ _root.gotoAndPlay(2);}

```

---

<div class="post-metadata">

**Author:** ![azuuh](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@azuuh](https://forum.kirupa.com/u/azuuh)\
**Post date:** [April 5, 2006, 6:29pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/9 "2006-04-05T18:29:49Z")

</div>

omg. it works now, i tryed that earlier and it didnt work so i posted this topic here…like i sayd “lol i suck doing things clean.” thats true, i had a different main.swf in the same folder as the sivu were in and the one “real” “main” were in a different folder and hohoho i am such an idiot.  
well thank you guys a lot for the trouble^^

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 5, 2006, 6:31pm UTC](https://forum.kirupa.com/t/button-actions-on-a-loadmovie/184516/10 "2006-04-05T18:31:11Z")

</div>

try to do i relativly though as the \_root can casue you issues if you open it by it’self
