# Load external swf, buttons don't work, tried everything, head hurts

**URL:** https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607
**Category:** Uncategorized
**Created:** [September 8, 2004, 12:07pm UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607 "2004-09-08T12:07:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rberry88](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rberry88](https://forum.kirupa.com/u/rberry88)
#### Post date: [September 8, 2004, 12:07pm UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607/1 "2004-09-08T12:07:44Z")

</div>

I’ve been banging my head against the wall on this one.

I have my main site (index.swf) that I put a button on one of the sections and the actionscript on the timeline.

Here is the AS on the timeline of my main site (index.swf):

```auto

pgroup1.onPress = function(){
createEmptyMovieClip("picgroup1", 1);
picgroup1.loadMovie("http://rberry883.home.comcast.net/petpics.swf");
picgroup1._x = 0;
picgroup1._y = 160;
picgroup1.border=false;
}

```

\*\* this will load the external swf (petpics.swf) just fine but the buttons don’t work. The button instance name is “pgroup1”.

And here is the AS code that is on the movie clip of my external swf (petpics.swf) that is supposed to let the buttons function:

```auto

onClipEvent(load){
        this._x = 200;
        this._y = 50;
        this.div = 5;
}
onClipEvent(enterFrame){
        this._x += (endX-_x)/div;
        this._y += (endY-_y)/div;

_parent.btnp1.onRelease=function(){
        this.endX= 200;
        this.endY= 50;
};
_parent.btnp2.onRelease=function(){
        this.endX= -50;
        this.endY= 50;
};
_parent.btnp3.onRelease=function(){
        this.endX= -300;
        this.endY= 50;
};
_parent.btnp4.onRelease=function(){
        this.endX= 200;
        this.endY= -150;
};
_parent.btnp5.onRelease=function(){
        this.endX= -50;
        this.endY= -150;
};
_parent.btnp6.onRelease=function(){
        this.endX= -300;
        this.endY= -150;
};
}

```

Now this swf works on its own if I take the “\_parent” tags off ( I also tried with this.) but same results. The buttons have instance names btnp1 - btnp6 and are used to move the movie clip with an instance name of “se” but the buttons don’t work when loaded into my main site.

Here is my page I uploaded it to, Once loaded, click on the Photos button and then on the #1 button on the right and you’ll see the external swf load but the buttons won’t work.

My site: [http://rberry883.home.comcast.net](http://rberry883.home.comcast.net)

Any help is appreciated.

rberry88

---

<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 8, 2004, 4:11pm UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607/2 "2004-09-08T16:11:04Z")

</div>

tried \_parent.\_parent ??

---

<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 8, 2004, 8:01pm UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607/3 "2004-09-08T20:01:38Z")

</div>

check this tutorial it should answer your problem, [click here.](http://www.kirupa.com/developer/mx/full_site.htm)

---

<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 8, 2004, 11:15pm UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607/4 "2004-09-08T23:15:12Z")

</div>

> [@Fidelity88](#):
>
> check this tutorial it should answer your problem, [click here.](http://www.kirupa.com/developer/mx/full_site.htm)

No, that didn’t help. I’m loading my external .swf into an emptyMovieClip that is defined by actionscript which also contains the code for the buttons. That tutorial just puts the AS on the button and calls the premade MC that is already place on the stage into action.

I’m trying the \_parent.\_parent method now, will post results in a little bit.

Thanks for the help though, every little bit helps.

_edit_ I tried the \_parent.\_parent. method and that didn’t work, I also tried this.\_parent.\_parent. and that didn’t work either.

Here is the swf on its own (in a separate location) that shows how it is supposed to work. [http://rberry883.home.comcast.net/movies/petpics.swf](http://rberry883.home.comcast.net/movies/petpics.swf)

The .fla is in the zip file above, if someone could help me get it loaded into an emptyMovieClip on my main site so the buttons function I would greatly 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: [September 9, 2004, 2:01am UTC](https://forum.kirupa.com/t/load-external-swf-buttons-dont-work-tried-everything-head-hurts/63607/5 "2004-09-09T02:01:19Z")

</div>

Okay, got it solved. I cleared all the AS on the frame and typed it all in again using \_parent. and it works fine now.
