# gotoAndplay in main from external .swf file?

**URL:** https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661
**Category:** flash
**Created:** [April 19, 2003, 3:08am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661 "2003-04-19T03:08:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Lacuna](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@Lacuna](https://forum.kirupa.com/u/Lacuna)
#### Post date: [April 19, 2003, 3:08am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/1 "2003-04-19T03:08:41Z")

</div>

Can it be done?

Can you have a/s in the external swf that runs a ‘gotoAndplay’ in the main movie?  
I want the swf to be halfway through when the picture on my main swf changes.

:love: ~ Seretha

(I can’t load the picture in with the external swf because they have to be unloaded at different times and the picture HAS to load on a level under the external swf.)

---

<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: [April 19, 2003, 3:25am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/2 "2003-04-19T03:25:29Z")

</div>

Sure, after the movie is loaded, just target the \_root 🙂

Since when you load a movie, the \_root timeline of the loaded movie now becomes the \_root timeline of the main movie, all you have to do is use \_root to get to the \_root timeline of the main movie 😛

---

<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: [April 19, 2003, 3:28am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/3 "2003-04-19T03:28:48Z")

</div>

!?!!?!

Are you saying I can (in the external file) say something similar to \_root.gotoAndPlay(5)

and will work?

Wow…i hope that’s what you’re saying [runs off to check it out]

:love:

---

<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: [April 19, 2003, 3:30am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/4 "2003-04-19T03:30:09Z")

</div>

Yeah, thats what I am saying 🙂

---

<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: [April 19, 2003, 3:39am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/5 "2003-04-19T03:39:57Z")

</div>

so i’ve added the script…  
In last frame of external swf…

```php

_root.gotoAndStop(10)

```

and when i load my main movie it runs the full external movie and then skips to frame 10 of it and stops, why did it not take the \_root of the main movie like it should be?

---

<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: [April 19, 2003, 3:45am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/6 "2003-04-19T03:45:21Z")

</div>

Works fine for me.

Are you using loadMovie or loadMovieNum?

---

<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: [April 19, 2003, 3:46am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/7 "2003-04-19T03:46:53Z")

</div>

if loadMovieNum then you need to use \_level0 instead of \_root, because with loadMovieNum you are loading to levels instead of clips.

---

<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: [April 19, 2003, 3:54am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/8 "2003-04-19T03:54:51Z")

</div>

Whoo-hoooo!!

I love you Lostinbeta! I changed it to be a loadMovieNum instead with the matching level0 and it works!

You are truly amazing. :love:

I’m glad you’re here at the forums to help us out.

:love: ~ Seretha

---

<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: [April 19, 2003, 3:56am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/9 "2003-04-19T03:56:17Z")

</div>

LOL, all I helped with was changing \_root to \_level0… nothing really amazing about that :-\

But 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: [April 19, 2003, 4:01am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/10 "2003-04-19T04:01:55Z")

</div>

sometimes it’s the little things, like a missing . or ; for example that can completely screw up your code. Have a good night, 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: [April 19, 2003, 4:07am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/11 "2003-04-19T04:07:58Z")

</div>

![](http://dw-world.de/dwelle/allgemein/bilder_show/0,3772,33681_1,00.jpg)

Rev ![](http://www.aulman.com/rev.gif)

---

<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: [April 19, 2003, 4:16am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/12 "2003-04-19T04:16:28Z")

</div>

![](http://www.xxviii.net/images/k/lips.jpg)  
yup, i have a life

---

<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: [April 19, 2003, 4:20am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/13 "2003-04-19T04:20:22Z")

</div>

I have a few questionf of myself about this subject. So wat you’re saying LIB is that you have a loadMovie in your file, from that loaded movie you can tell level1 to go to and play a certain frame of the level1 movie? If this is true, I would like to know how to assign a level number to a movie(target)… is it possible?:sigh:

---

<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: [April 19, 2003, 4:25am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/14 "2003-04-19T04:25:27Z")

</div>

newbieMX:

the levels are already there, you just need to loadmovie into \_level10 or whatever and it is there…

There are a bunch of tutorials on this site that show how to use levels…

Rev ![](http://www.aulman.com/rev.gif)

---

<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: [April 19, 2003, 4:32am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/15 "2003-04-19T04:32:45Z")

</div>

ok, well true, i kinda knew that, but i was wondering if you could assign levels to movie clips etc…?

---

<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: [April 19, 2003, 4:36am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/16 "2003-04-19T04:36:20Z")

</div>

Yes, you can assign movie clips to levels by using swapDepths(), only one movie clip can reside on each level though, so beware.

You have to assign clips to levels when using code like createEmptyMovieClip, attachMovie, duplicateMovieClip, etc. You can’t dynamically put an object on the stage itself, so instead you dynamically add it to a level, so it displays as though it were on the stage… but above everything else (if you start at 1… considering the objects on the stage are actually at level -gazillion [not a real number, but its low]).

And 28, I have no life either…

---

<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: [April 19, 2003, 4:38am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/17 "2003-04-19T04:38:51Z")

</div>

haha Lost, yours is cooler than mine tho  
btw, did you get my pm?

---

<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: [April 19, 2003, 4:40am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/18 "2003-04-19T04:40:02Z")

</div>

Mine just represents my current mood is all.

And umm… lemme check if I got 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: [April 19, 2003, 5:16am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/19 "2003-04-19T05:16:50Z")

</div>

ya gotta go with the purple anyways…

---

<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: [April 19, 2003, 5:18am UTC](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661/20 "2003-04-19T05:18:01Z")

</div>

lol  
look what i did to this poor defenseless thread

[Next page](https://forum.kirupa.com/t/gotoandplay-in-main-from-external-swf-file/18661.md?page=2)
